/* ============================================================================
   CSS VARIABLES - Premium Light & Dark Mode
   ============================================================================ */
:root {
    /* Light Mode - Premium Palette */
    --bg-body: rgba(0, 0, 0, 0);       /* Transparent - No gray background */
    --bg-surface: #FFFFFF;    /* White */
    
    /* Text */
    --text-primary: #0F172A;  /* Slate 900 - Đen than chủ động */
    --text-secondary: #111827; /* Gray 900 - Main text */
    --text-muted: #6B7280;    /* Gray 500 */
    
    /* Actions / Buttons */
    --primary-color: #111827; /* Black accent */
    --primary-hover: #000000; 
    --btn-text: #FFFFFF;      
    
    /* Borders */
    --border-color: #E5E7EB;  /* Gray 200 */
    
    /* Accents */
    --success: #10B981;       /* Green 500 */
    --danger: #EF4444;        /* Red 500 */
    --warning: #F59E0B;       /* Amber 500 */
    --info: #3B82F6;          /* Blue 500 */
    
    /* Sidebar */
    --sidebar-bg: #FFFFFF;
    --sidebar-active-bg: #F9FAFB;
    --sidebar-active-text: #111827;
    --sidebar-hover-bg: #F9FAFB;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* Dark Mode - Slate/Navy Premium Palette */
    --bg-body: #0F172A;       /* Slate 900 - Deep navy blue */
    --bg-surface: #1E293B;    /* Slate 800 - Card surface */
    
    /* Text */
    --text-primary: #F8FAFC;  /* Slate 50 - Soft white */
    --text-secondary: #F1F5F9; /* Slate 100 - Main text (softer white) */
    --text-muted: #94A3B8;    /* Slate 400 */
    
    /* Actions / Buttons */
    --primary-color: #F8FAFC; /* Soft white accent */
    --primary-hover: #FFFFFF; 
    --btn-text: #0F172A;      /* Dark text on light buttons */
    
    /* Borders */
    --border-color: #334155;  /* Slate 700 */
    
    /* Accents */
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    
    /* Sidebar */
    --sidebar-bg: #1E293B;
    --sidebar-active-bg: #0F172A;
    --sidebar-active-text: #F8FAFC;
    --sidebar-hover-bg: #334155;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--text-secondary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   DASHBOARD LAYOUT
   ============================================================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                transform 0.3s ease, 
                background-color 0.3s ease, 
                border-color 0.3s ease;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: padding 0.3s ease;
}

.sidebar.collapsed .sidebar-header {
    padding: 24px 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.sidebar.collapsed .logo {
    justify-content: center;
    gap: 0;
    margin-bottom: 0;
}

.logo i {
    font-size: 1.75rem;
    color: var(--primary-color);
    transition: font-size 0.3s ease;
}

.sidebar.collapsed .logo i {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed .logo h1 {
    width: 0;
    opacity: 0;
    margin: 0;
}

.sidebar-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    padding-left: 42px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease;
    font-weight: 400;
}

.sidebar.collapsed .sidebar-subtitle {
    height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.sidebar-nav .tab-btn {
    width: 100%;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    margin: 2px 0;
}

.sidebar.collapsed .tab-btn {
    padding: 10px;
    justify-content: center;
}

.sidebar-nav .tab-btn i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.sidebar.collapsed .tab-btn i {
    width: auto;
    font-size: 1.25rem;
}

.tab-btn-text {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed .tab-btn-text {
    width: 0;
    opacity: 0;
}

.sidebar-nav .tab-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--text-primary);
}

.sidebar-nav .tab-btn:hover i {
    color: var(--text-primary);
}

.sidebar-nav .tab-btn.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.sidebar-nav .tab-btn.active i {
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    transition: padding 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar.collapsed .sidebar-footer {
    padding: 20px 10px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: gap 0.3s ease;
}

.sidebar.collapsed .theme-toggle {
    gap: 0;
    flex-direction: column;
}

.theme-toggle i {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .theme-toggle i:first-child,
.sidebar.collapsed .theme-toggle i:last-child {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

[data-theme="dark"] .toggle-slider:before {
    background-color: #0F172A;
}

.sidebar-collapse-btn {
    width: 100%;
    height: 36px;
    margin-top: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-collapse-btn:hover {
    background: var(--sidebar-hover-bg);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.sidebar-collapse-btn i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

.sidebar-tooltip {
    position: fixed;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10000;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    font-weight: 500;
}

.sidebar-tooltip.show {
    opacity: 1;
    transform: translateX(0);
}

/* Sidebar Toggle Button (Mobile) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.125rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover-bg);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
    min-height: 100vh;
    transition: margin-left 0.3s ease, background-color 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 80px;
}

/* ============================================================================
   CARD STYLES
   ============================================================================ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ============================================================================
   TAB CONTENT
   ============================================================================ */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tab-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

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

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    padding: 10px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: var(--primary-color);
    color: var(--btn-text);
    font-family: inherit;
}

.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

[data-theme="dark"] .btn:focus {
    box-shadow: 0 0 0 3px rgba(248, 250, 252, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--btn-text);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-success {
    background: var(--primary-color);
    color: var(--btn-text);
    border-color: var(--primary-color);
}

.btn-success:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: var(--primary-color);
    color: var(--btn-text);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-danger {
    background: var(--primary-color);
    color: var(--btn-text);
    border-color: var(--primary-color);
}

.btn-danger:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-warning {
    background: var(--primary-color);
    color: var(--btn-text);
    border-color: var(--primary-color);
}

.btn-warning:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-info {
    background: var(--primary-color);
    color: var(--btn-text);
    border-color: var(--primary-color);
}

.btn-info:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-light {
    background: var(--primary-color);
    color: var(--btn-text);
    border-color: var(--primary-color);
}

.btn-light:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-xxs {
    padding: 2px 6px;
    font-size: 11px;
}

/* ============================================================================
   FILTERS
   ============================================================================ */
.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    height: 40px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 400;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.05);
    background-color: var(--bg-surface);
}

[data-theme="dark"] .search-box input:focus {
    box-shadow: 0 0 0 4px rgba(248, 250, 252, 0.05);
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-icon {
    display: block;
}

.clear-search {
    display: none !important;
    cursor: pointer;
    color: var(--danger);
    font-size: 12px;
    right: 8px;
    pointer-events: auto;
    transition: color 0.2s;
}

.clear-search:hover {
    color: #DC2626;
}

.search-box.has-content .search-icon {
    display: none !important;
}

.search-box.has-content .clear-search {
    display: block !important;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    margin-top: -1px;
}

.autocomplete-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.highlighted {
    background-color: var(--sidebar-hover-bg);
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion .suggestion-type {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.autocomplete-suggestion .suggestion-text {
    color: var(--text-secondary);
}

.user-filter,
.ip-type-filter,
.network-filter,
.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-filter label,
.ip-type-filter label,
.network-filter label,
.date-filter label {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 14px;
}

.ip-type-filter select,
.network-filter select,
.date-filter input,
.date-filter select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    min-width: 120px;
    height: 40px;
    box-sizing: border-box;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 400;
}

.ip-type-filter select:focus,
.network-filter select:focus,
.date-filter input:focus,
.date-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.05);
    background-color: var(--bg-surface);
}

[data-theme="dark"] .ip-type-filter select:focus,
[data-theme="dark"] .network-filter select:focus,
[data-theme="dark"] .date-filter input:focus,
[data-theme="dark"] .date-filter select:focus {
    box-shadow: 0 0 0 4px rgba(248, 250, 252, 0.05);
}

.filter-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Specific styling for Log IP tab filters */
#log-ip .filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

#log-ip .search-box {
    flex: 1 1 300px;
    min-width: 250px;
    max-width: none;
}

#log-ip .user-filter {
    flex: 0 0 auto;
    white-space: nowrap;
}

#log-ip .ip-type-filter {
    flex: 0 0 auto;
    white-space: nowrap;
}

#log-ip .network-filter {
    flex: 0 0 auto;
    white-space: nowrap;
}

#log-ip .date-filter {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 10px;
}

/* ============================================================================
   TABLES - Premium Styling
   ============================================================================ */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
    border-spacing: 0;
    outline: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.data-table:focus {
    outline: none;
}

.data-table th {
    color: var(--text-primary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    /* --- Hiệu ứng kính mờ (Frosted Glass) --- */
    background: rgba(249, 250, 251, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .data-table th {
    background: rgba(30, 41, 59, 0.85);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--text-secondary);
    font-weight: 400;
}

.data-table tbody tr:hover {
    background: var(--sidebar-hover-bg);
    transition: background 0.2s ease;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

/* Location column specific styling */
.data-table td:nth-child(7) {
    max-width: 150px;
    white-space: normal;
    word-break: break-word;
}

/* IP column specific styling */
.data-table td:nth-child(4) {
    white-space: normal;
    word-break: break-all;
}

/* Contract column specific styling */
.data-table td:nth-child(8) {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0;
}

/* Handle line breaks in contract column */
.data-table td:nth-child(8) br {
    display: block;
    content: "";
    margin-top: 2px;
}

/* User pairs table column widths */
#userPairsTable th:nth-child(1),
#userPairsTable td:nth-child(1) {
    width: 120px;
    max-width: 120px;
}

#userPairsTable th:nth-child(2),
#userPairsTable td:nth-child(2) {
    width: 120px;
    max-width: 120px;
}

#userPairsTable th:nth-child(3),
#userPairsTable td:nth-child(3) {
    width: 100px;
    text-align: center;
}

#userPairsTable th:nth-child(4),
#userPairsTable td:nth-child(4) {
    width: 100px;
    text-align: center;
}

#userPairsTable th:nth-child(5),
#userPairsTable td:nth-child(5) {
    min-width: 500px;
    width: auto;
}

/* IP column with copy icon */
.ip-with-copy {
    position: relative;
    padding-left: 35px;
}

.ip-text {
    word-break: break-all;
    display: block;
}

.ip-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.ip-link:hover {
    text-decoration: underline;
    color: var(--primary-color) !important;
}

.copy-icon {
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--primary-color);
    font-size: 14px;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: transparent;
}

.copy-icon:hover {
    background: var(--sidebar-hover-bg);
    color: var(--primary-color);
}

.copy-icon:active {
    transform: translateY(-50%) scale(0.95);
}

/* Column width adjustments for different tables */
#logTable th:nth-child(1), #logTable td:nth-child(1) { width: 5%; }
#logTable th:nth-child(2), #logTable td:nth-child(2) { width: 15%; }
#logTable th:nth-child(3), #logTable td:nth-child(3) { width: 15%; }
#logTable th:nth-child(4), #logTable td:nth-child(4) { width: 18%; }
#logTable th:nth-child(5), #logTable td:nth-child(5) { width: 7%; }
#logTable th:nth-child(6), #logTable td:nth-child(6) { width: 15%; }
#logTable th:nth-child(7), #logTable td:nth-child(7) { width: 12%; }
#logTable th:nth-child(8), #logTable td:nth-child(8) { width: 13%; }

#ipListTable th:nth-child(1), #ipListTable td:nth-child(1) { width: 6%; }
#ipListTable th:nth-child(2), #ipListTable td:nth-child(2) { width: 20%; }
#ipListTable th:nth-child(3), #ipListTable td:nth-child(3) { width: 7%; }
#ipListTable th:nth-child(4), #ipListTable td:nth-child(4) { width: 18%; }
#ipListTable th:nth-child(5), #ipListTable td:nth-child(5) { width: 12%; }
#ipListTable th:nth-child(6), #ipListTable td:nth-child(6) { width: 7%; }
#ipListTable th:nth-child(7), #ipListTable td:nth-child(7) { width: 30%; }

#analysisTable th:nth-child(1), #analysisTable td:nth-child(1) { width: 6%; }
#analysisTable th:nth-child(2), #analysisTable td:nth-child(2) { width: 18%; }
#analysisTable th:nth-child(3), #analysisTable td:nth-child(3) { width: 7%; }
#analysisTable th:nth-child(4), #analysisTable td:nth-child(4) { width: 16%; }
#analysisTable th:nth-child(5), #analysisTable td:nth-child(5) { width: 12%; }
#analysisTable th:nth-child(6), #analysisTable td:nth-child(6) { width: 31%; }
#analysisTable th:nth-child(7), #analysisTable td:nth-child(7) { width: 10%; }

#compareTable th:nth-child(1), #compareTable td:nth-child(1) { width: 4%; }
#compareTable th:nth-child(2), #compareTable td:nth-child(2) { width: 8%; }
#compareTable th:nth-child(3), #compareTable td:nth-child(3) { width: 8%; }
#compareTable th:nth-child(4), #compareTable td:nth-child(4) { width: 10%; }
#compareTable th:nth-child(5), #compareTable td:nth-child(5) { width: 7%; }
#compareTable th:nth-child(6), #compareTable td:nth-child(6) { width: 6%; }
#compareTable th:nth-child(7), #compareTable td:nth-child(7) { width: 8%; }
#compareTable th:nth-child(8), #compareTable td:nth-child(8) { width: 8%; }
#compareTable th:nth-child(9), #compareTable td:nth-child(9) { width: 6%; }
#compareTable th:nth-child(10), #compareTable td:nth-child(10) { width: 6%; }
#compareTable th:nth-child(11), #compareTable td:nth-child(11) { width: 6%; }
#compareTable th:nth-child(12), #compareTable td:nth-child(12) { width: 6%; }
#compareTable th:nth-child(13), #compareTable td:nth-child(13) { width: 17%; }

/* Editable cells */
.editable-cell {
    position: relative;
}

.editable-cell input[type="text"] {
    width: 100%;
    padding: 8px 0px;
    border: none;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-weight: 400;
}

.editable-cell input[type="text"]:focus {
    outline: none;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.05);
    background: var(--bg-surface);
}

[data-theme="dark"] .editable-cell input[type="text"]:focus {
    box-shadow: 0 0 0 4px rgba(248, 250, 252, 0.05);
}

.editable-cell textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 400;
}

.editable-cell textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.05);
}

[data-theme="dark"] .editable-cell textarea:focus {
    box-shadow: 0 0 0 4px rgba(248, 250, 252, 0.05);
}

/* ============================================================================
   CHARTS
   ============================================================================ */
.chart-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.chart-section {
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.chart-section h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
    font-size: 1.125rem;
}

/* ============================================================================
   COMPARE OPTIONS
   ============================================================================ */
.compare-import-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    padding: 24px;
}

.compare-import-left,
.compare-import-right {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.compare-import-left h3,
.compare-import-right h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.125rem;
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--sidebar-hover-bg);
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--sidebar-active-bg);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: var(--sidebar-active-bg);
}

.file-upload-content i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.file-upload-content p {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.file-upload-content small {
    color: var(--text-muted);
    font-size: 13px;
}

.file-info {
    margin-top: 15px;
}

.file-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--sidebar-hover-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item i {
    font-size: 1.125rem;
    color: var(--success);
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-item-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.file-item-size {
    font-size: 13px;
    color: var(--text-muted);
}

.file-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.file-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================================================
   MODAL
   ============================================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    margin: 3% auto;
    padding: 30px;
    border-radius: 8px;
    width: 300px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User Management Modal */
.user-management-modal {
    max-width: 1200px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
}

.modal-header h3 i {
    margin-right: 8px;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--sidebar-hover-bg);
    color: var(--danger);
}

.modal-body {
    padding: 0 20px 20px 20px;
}

.user-management-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    padding: 0 20px;
}

/* Fix icon positioning in modal search boxes */
.user-management-modal .search-box,
.user-management-modal .modal-body .search-box {
    padding: 0 !important;
}

.user-management-modal .search-box .search-icon,
.user-management-modal .modal-body .search-box .search-icon {
    right: 15px !important;
}

.user-management-modal .search-box .clear-search,
.user-management-modal .modal-body .search-box .clear-search {
    right: 8px !important;
}

.user-management-modal .search-box input,
.user-management-modal .modal-body .search-box input {
    padding: 12px 40px 12px 15px;
}

.user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
    padding: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--sidebar-hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 13px;
    min-height: 45px;
    cursor: pointer;
}

.user-item:hover {
    background: var(--sidebar-active-bg);
    border-color: var(--primary-color);
}

.user-item.selected {
    background: var(--sidebar-active-bg);
    border-color: var(--primary-color);
}

.user-item input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.user-info {
    flex: 1;
    cursor: pointer;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1px;
}

.user-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================================================
   STATUS INDICATORS
   ============================================================================ */
.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}

/* ============================================================================
   IP LOOKUP PROGRESS
   ============================================================================ */
.ip-lookup-progress {
    padding: 20px;
    margin-bottom: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.progress-header h4 i {
    margin-right: 8px;
    color: var(--primary-color);
}

.progress-container {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--sidebar-hover-bg);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color));
    border-radius: 8px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
}

.progress-details {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 16px;
}

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

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

.pagination-pages {
    display: flex;
    gap: 4px;
}

.pagination-pages button {
    padding: 6px 10px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: var(--btn-text);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    font-weight: 400;
}

.pagination-pages button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.pagination-pages button.active {
    background: var(--primary-color);
    color: var(--btn-text);
    border-color: var(--primary-color);
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-size label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination-size select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 400;
}

.pagination-page-info {
    margin-left: 10px;
    font-weight: 500;
    color: var(--text-primary);
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 5px;
}

.pagination-jump label {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

.pagination-jump input[type="number"] {
    font-size: 14px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 400;
}

.pagination-jump input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   SCROLL TO TOP BUTTON
   ============================================================================ */
.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: var(--btn-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.scroll-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.scroll-to-top-btn:active {
    transform: translateY(-1px) scale(0.95);
}

.scroll-to-top-btn i {
    margin: 0;
}

/* ============================================================================
   REPORT TAB STYLES
   ============================================================================ */
.report-container {
    margin-top: 24px;
}

#importErrorsContainer {
    padding: 20px;
}

#importErrorsContent {
    font-size: 14px;
    color: var(--text-secondary);
}

#importErrorsContent ul {
    list-style-type: disc;
    padding-left: 20px;
}

#importErrorsContent li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.report-section {
    padding: 24px;
    margin-bottom: 24px;
}

.report-section h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.report-section h3 i {
    color: var(--primary-color);
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: var(--primary-color);
    border-radius: 8px;
    padding: 24px;
    color: var(--btn-text);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-card:nth-child(2) {
    background: var(--primary-color);
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 600;
}

.isp-stats-container {
    margin-top: 20px;
    overflow-x: auto;
}

#ispStatsTable {
    width: 100%;
    min-width: 400px;
}

#ispStatsTable th {
    color: var(--text-primary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    /* --- Hiệu ứng kính mờ (Frosted Glass) --- */
    background: rgba(249, 250, 251, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] #ispStatsTable th {
    background: rgba(30, 41, 59, 0.85);
}

#ispStatsTable td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 400;
}

#ispStatsTable tbody tr:hover {
    background: var(--sidebar-hover-bg);
}

#ispStatsTable tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] #ispStatsTable tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

/* ============================================================================
   MESSAGES
   ============================================================================ */
.message {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 9999;
    max-width: 400px;
    box-shadow: var(--shadow-sm);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.message.show {
    transform: translateX(0);
}

.message.success {
    background: var(--primary-color);
    color: var(--btn-text);
    border: 1px solid var(--primary-color);
}

.message.error {
    background: var(--primary-color);
    color: var(--btn-text);
    border: 1px solid var(--primary-color);
}

.message.warning {
    background: var(--primary-color);
    color: var(--btn-text);
    border: 1px solid var(--primary-color);
}

.message.info {
    background: var(--primary-color);
    color: var(--btn-text);
    border: 1px solid var(--primary-color);
}

/* ============================================================================
   CONFIRM MODAL
   ============================================================================ */
.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-modal.show {
    opacity: 1;
    display: flex;
}

.confirm-modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    width: 90%;
    max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-modal.show .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.confirm-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.confirm-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.confirm-modal-close:hover {
    background: var(--sidebar-hover-bg);
    color: var(--text-primary);
}

.confirm-modal-body {
    padding: 25px;
}

.confirm-modal-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

.confirm-modal-footer {
    display: flex;
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    gap: 12px;
    justify-content: center;
}

.btn-confirm-yes {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 12px 20px;
    background: var(--primary-color);
    color: var(--btn-text);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-confirm-yes:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-confirm-no {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 12px 20px;
    background: var(--primary-color);
    color: var(--btn-text);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-confirm-no:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ============================================================================
   FILE UPLOAD
   ============================================================================ */
.file-upload input[type="file"] {
    display: none;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================================================
   CUSTOM SCROLLBAR - Modern Native App Style
   ============================================================================ */
/* Global scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1; /* Light gray for Light Mode */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155; /* Slate color for Dark Mode */
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Specific scrollbars for containers */
.table-container::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.user-list::-webkit-scrollbar,
.file-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track,
.user-list::-webkit-scrollbar-track,
.file-list::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.user-list::-webkit-scrollbar-thumb,
.file-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.user-list::-webkit-scrollbar-thumb:hover,
.file-list::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

[data-theme="dark"] .table-container::-webkit-scrollbar-thumb,
[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb,
[data-theme="dark"] .user-list::-webkit-scrollbar-thumb,
[data-theme="dark"] .file-list::-webkit-scrollbar-thumb {
    background: #334155;
}

[data-theme="dark"] .table-container::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .user-list::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .file-list::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px !important;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: 280px !important;
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 20px 15px;
        padding-top: 70px;
    }

    .tab-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .actions {
        justify-content: center;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: auto;
    }

    .chart-container {
        grid-template-columns: 1fr;
    }

    .compare-import-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    .pagination-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .pagination-controls {
        order: 2;
    }

    .pagination-info {
        order: 1;
    }

    .pagination-size {
        order: 3;
    }

    .scroll-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .report-stats {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 2rem;
    }

    .confirm-modal {
        padding-top: 10%;
    }

    .confirm-modal-content {
        width: 95%;
        max-width: none;
    }

    .confirm-modal-footer {
        flex-direction: column;
    }

    .btn-confirm-yes,
    .btn-confirm-no {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px 10px;
        padding-top: 70px;
    }

    .tab-content {
        padding: 15px;
    }

    .btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    .sidebar {
        width: 100%;
    }
}
