/* ===================================================
   ระบบฐานข้อมูลผู้รับผิดชอบหลักสูตร
   Premium Dark Theme with Glassmorphism
   =================================================== */

/* --- CSS Variables / Design Tokens --- */
:root {
    --bg-primary: #f4f6f9;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.85);

    --accent: #4a90e2;    /* Soft Blue */
    --accent-glow: rgba(74, 144, 226, 0.2);
    --accent-2: #65b891;   /* Soft Green */
    --accent-3: #7b61ff;   /* Soft Purple */
    --accent-gradient: linear-gradient(135deg, #4a90e2 0%, #7b61ff 100%);
    
    --success: #43b581;
    --warning: #f2a65a;
    --danger: #f04747;
    --info: #3db8c1;

    --text-primary: #2c3e50;
    --text-secondary: #5c6b7a;
    --text-muted: #95a5a6;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(74, 144, 226, 0.3);

    --sidebar-width: 260px;
    --topbar-height: 65px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 4px 15px var(--accent-glow);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    --font-main: 'Sarabun', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Base Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 15px;
    line-height: 1.6;
}

/* Background gradient mesh */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(74, 144, 226, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(123, 97, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(101, 184, 145, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8a82ff;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    backdrop-filter: blur(20px);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 15px 12px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    margin-bottom: 4px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-nav .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
    transition: var(--transition);
}

.sidebar-nav .nav-link:hover {
    background: rgba(74, 144, 226, 0.08);
    color: var(--accent);
    transform: translateX(4px);
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav .nav-item.active .nav-link {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-nav .nav-item.active .nav-link::before {
    transform: translateY(-50%) scaleY(1);
}

.sidebar-nav .nav-item.active .nav-link i {
    color: var(--accent);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.import-btn-wrapper {
    margin-bottom: 10px;
}

.btn-import {
    width: 100%;
    padding: 10px;
    background: rgba(108, 99, 255, 0.12);
    border: 1px dashed var(--accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.btn-import:hover {
    background: rgba(108, 99, 255, 0.25);
    color: white;
    box-shadow: var(--shadow-glow);
}

.version-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

/* --- Top Bar --- */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
}

.btn-toggle-sidebar {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
}

.btn-toggle-sidebar:hover {
    background: rgba(108, 99, 255, 0.15);
}

.top-bar-title {
    font-size: 20px;
    font-weight: 700;
    flex: 1;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bg-primary-gradient {
    background: var(--accent-gradient) !important;
    border: none;
    font-size: 13px;
    padding: 6px 14px;
}

/* --- Page Content --- */
.page-content {
    padding: 24px;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-glow);
}

.glass-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}

.glass-card .card-body {
    padding: 20px;
}

/* --- Stat Cards --- */
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-glow);
}

.stat-card.accent-1::before { background: var(--accent-gradient); }
.stat-card.accent-2::before { background: linear-gradient(90deg, var(--accent-3), var(--success)); }
.stat-card.accent-3::before { background: linear-gradient(90deg, var(--warning), #ff6b6b); }
.stat-card.accent-4::before { background: linear-gradient(90deg, var(--success), var(--accent)); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}

.stat-card.accent-1 .stat-icon { background: rgba(108, 99, 255, 0.15); color: var(--accent); }
.stat-card.accent-2 .stat-icon { background: rgba(0, 210, 255, 0.15); color: var(--accent-3); }
.stat-card.accent-3 .stat-icon { background: rgba(255, 179, 71, 0.15); color: var(--warning); }
.stat-card.accent-4 .stat-icon { background: rgba(0, 200, 151, 0.15); color: var(--success); }

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.stat-card .stat-change {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
}

/* --- Tables --- */
.table-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-container .table-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.table-container .table-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 16px;
}

.table {
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    background: rgba(108, 99, 255, 0.08);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    padding: 12px 16px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 14px;
}

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

.table tbody tr:hover {
    background: rgba(74, 144, 226, 0.04);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* --- Badges --- */
.badge-eligible {
    background: rgba(0, 200, 151, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 200, 151, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-not-eligible {
    background: rgba(233, 69, 96, 0.15);
    color: var(--danger);
    border: 1px solid rgba(233, 69, 96, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-role {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent);
    border: 1px solid rgba(108, 99, 255, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-year {
    background: rgba(0, 210, 255, 0.12);
    color: var(--info);
    border: 1px solid rgba(0, 210, 255, 0.25);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
}

/* --- Buttons --- */
.btn-accent {
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 14px;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
    color: white;
}

.btn-accent:active {
    transform: translateY(0);
}

.btn-outline-accent {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 500;
    padding: 6px 16px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    font-size: 13px;
}

.btn-outline-accent:hover {
    background: rgba(108, 99, 255, 0.15);
    color: white;
    border-color: var(--accent);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    border: none;
    font-size: 15px;
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-icon.btn-edit {
    background: rgba(0, 210, 255, 0.12);
    color: var(--accent-3);
}
.btn-icon.btn-edit:hover {
    background: rgba(0, 210, 255, 0.3);
}

.btn-icon.btn-delete {
    background: rgba(233, 69, 96, 0.12);
    color: var(--danger);
}
.btn-icon.btn-delete:hover {
    background: rgba(233, 69, 96, 0.3);
}

.btn-icon.btn-fetch {
    background: rgba(0, 200, 151, 0.12);
    color: var(--success);
}
.btn-icon.btn-fetch:hover {
    background: rgba(0, 200, 151, 0.3);
}

.btn-icon.btn-view {
    background: rgba(108, 99, 255, 0.12);
    color: var(--accent);
}
.btn-icon.btn-view:hover {
    background: rgba(108, 99, 255, 0.3);
}

/* --- Forms --- */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group-text {
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--accent);
    border-radius: var(--radius-xs);
}

/* --- Search box --- */
.search-box {
    position: relative;
    max-width: 300px;
}

.search-box .form-control {
    padding-left: 38px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

/* --- Modals --- */
.modal-content.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
}

.modal-content.glass-card .modal-header {
    padding: 20px 24px;
}

.modal-content.glass-card .modal-title {
    font-weight: 700;
    font-size: 18px;
}

.modal-content.glass-card .modal-body {
    padding: 20px 24px;
}

.modal-content.glass-card .modal-footer {
    padding: 16px 24px;
}

.btn-close-white {
    filter: none;
}

/* --- Alerts custom --- */
.alert-info-custom {
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--accent-3);
    border-radius: var(--radius-xs);
    padding: 12px 16px;
    font-size: 13px;
}

.alert-warning-custom {
    background: rgba(255, 179, 71, 0.08);
    border: 1px solid rgba(255, 179, 71, 0.2);
    color: var(--warning);
    border-radius: var(--radius-xs);
    padding: 12px 16px;
    font-size: 13px;
}

/* --- Progress --- */
.progress {
    height: 8px;
    background: rgba(108, 99, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar.bg-accent {
    background: var(--accent-gradient) !important;
}

/* --- Chart Container --- */
.chart-container {
    position: relative;
    padding: 16px;
}

/* --- Eligibility Ring --- */
.eligibility-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

/* --- Scholar Link --- */
.scholar-link {
    color: var(--accent-3);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition-fast);
}

.scholar-link:hover {
    color: var(--info);
    text-decoration: underline;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state .empty-icon {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state .empty-text {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 20px;
}

/* --- Pulse Animation --- */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-dot 2s ease-in-out infinite;
}

.pulse-dot.green { background: var(--success); }
.pulse-dot.red { background: var(--danger); }

/* --- Skeleton Loading --- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, rgba(50,50,80,0.4) 25%, rgba(60,60,90,0.6) 50%, rgba(50,50,80,0.4) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-xs);
}

/* --- Fade In Animation --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

.fade-in-up:nth-child(1) { animation-delay: 0.05s; }
.fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.fade-in-up:nth-child(3) { animation-delay: 0.15s; }
.fade-in-up:nth-child(4) { animation-delay: 0.2s; }

/* --- Pagination --- */
.pagination .page-item .page-link {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    margin: 0 2px;
    font-size: 13px;
    transition: var(--transition-fast);
}

.pagination .page-item .page-link:hover {
    background: rgba(108, 99, 255, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination .page-item.active .page-link {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* --- SweetAlert Dark Theme --- */
.swal2-popup {
    background: rgba(22, 33, 62, 0.98) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius) !important;
    backdrop-filter: blur(30px) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
}

.swal2-html-container {
    color: var(--text-secondary) !important;
}

.swal2-input, .swal2-textarea {
    background: rgba(20, 20, 40, 0.8) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.swal2-confirm {
    background: var(--accent-gradient) !important;
    border: none !important;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .btn-toggle-sidebar {
        display: block;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 16px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
    
    .table-container .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        max-width: 100%;
        width: 100%;
    }
}

/* --- Tooltip styling --- */
.tooltip-inner {
    background: rgba(22, 33, 62, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    font-size: 12px;
}

/* --- Tag / Chip --- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(108, 99, 255, 0.2);
}

/* --- Notification dot --- */
.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

/* --- Filter toolbar --- */
.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-toolbar .form-select {
    max-width: 200px;
    font-size: 13px;
    padding: 8px 12px;
}

/* --- Data row link --- */
.data-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.data-link:hover {
    color: #8a82ff;
    text-decoration: underline;
}

/* --- Spinner --- */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* --- Section title --- */
.section-title {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* --- Floating action button --- */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(108, 99, 255, 0.6);
}

/* --- Count animation --- */
.count-up {
    display: inline-block;
}

/* --- Table Sorting --- */
th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 24px !important;
    transition: background 0.2s;
}
th.sortable:hover {
    background: rgba(108, 99, 255, 0.15);
}
th.sortable::after {
    content: '\F144'; /* bi-arrow-down-up */
    font-family: 'bootstrap-icons';
    position: absolute;
    right: 8px;
    opacity: 0.2;
    font-size: 11px;
}
th.sort-asc::after {
    content: '\F286'; /* bi-chevron-up */
    opacity: 1;
    color: var(--accent);
    font-size: 12px;
}
th.sort-desc::after {
    content: '\F27F'; /* bi-chevron-down */
    opacity: 1;
    color: var(--accent);
    font-size: 12px;
}
