/* CSS Variables & Theme Definitions */
:root {
    --bg-main: #0a0712;
    --bg-sidebar: #100c1e;
    --bg-card: rgba(22, 17, 40, 0.65);
    --border-color: rgba(62, 54, 98, 0.4);
    --border-hover: rgba(131, 58, 180, 0.6);
    --text-primary: #f3f1f6;
    --text-secondary: #9a94b8;
    --text-muted: #645e85;
    
    /* Instagram Gradient Colors */
    --insta-purple: #833ab4;
    --insta-pink: #e1306c;
    --insta-orange: #fd1d1d;
    --insta-yellow: #fcb045;
    
    /* Functional Colors */
    --color-primary: #b549ff;
    --color-primary-glow: rgba(181, 73, 255, 0.3);
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #06b6d4;
    --color-star: #eab308;
    
    /* System Properties */
    --sidebar-width: 280px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    color-scheme: dark;
}

input, select, textarea {
    color-scheme: dark !important;
}

/* Reset and Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(131, 58, 180, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(225, 48, 108, 0.15) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Mobile Menu Toggle & Close Buttons (Desktop Hidden) */
.menu-toggle-btn, .menu-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle-btn:hover, .menu-close-btn:hover {
    color: var(--insta-pink);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 7, 18, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    animation: fadeIn 0.3s ease-out;
}

.sidebar-overlay.active {
    display: block;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    padding: 24px 16px;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 28px;
    background: linear-gradient(45deg, var(--insta-purple), var(--insta-pink), var(--insta-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(225, 48, 108, 0.4));
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #d3cce3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(131, 58, 180, 0.2), rgba(225, 48, 108, 0.1));
    border-color: rgba(225, 48, 108, 0.3);
    box-shadow: 0 4px 15px rgba(131, 58, 180, 0.15);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--insta-pink);
    filter: drop-shadow(0 0 5px rgba(225, 48, 108, 0.5));
}

.nav-divider {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    padding: 16px 16px 8px 16px;
    margin-top: 8px;
}

.sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 0 16px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Content Styling */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    min-width: 0; /* Prevents flex items from overflowing */
}

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

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

.header h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 32px;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    background: linear-gradient(to right, #ffffff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(45deg, var(--insta-purple), var(--insta-pink));
    color: white;
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 48, 108, 0.45);
}

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

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

/* Upload Zone */
.upload-zone {
    margin-bottom: 32px;
    animation: fadeIn 0.5s ease-out;
}

.upload-box {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    transition: var(--transition);
}

.upload-box:hover, .upload-box.dragover {
    border-color: var(--insta-pink);
    background-color: rgba(225, 48, 108, 0.03);
    box-shadow: 0 0 25px rgba(225, 48, 108, 0.1);
}

.upload-icon {
    font-size: 48px;
    background: linear-gradient(45deg, var(--insta-purple), var(--insta-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.upload-box h2 {
    font-family: var(--font-heading);
    margin-bottom: 12px;
}

.upload-box p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 24px auto;
    font-size: 14px;
}

.file-inputs {
    margin-bottom: 24px;
}

.hidden {
    display: none !important;
}

.uploaded-files-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 800px;
    margin: 0 auto;
}

.uploaded-file-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.uploaded-file-tag i {
    color: var(--color-success);
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    border-radius: var(--radius-lg);
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.cursor-pointer {
    cursor: pointer;
}

.gradient-1 {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
}

.gradient-2 {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
}

.gradient-3 {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    box-shadow: 0 10px 20px rgba(244, 63, 94, 0.15);
}

.gradient-3:hover {
    box-shadow: 0 15px 30px rgba(244, 63, 94, 0.3);
}

.gradient-4 {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
}

.gradient-5 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.15);
}

.gradient-5:hover {
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.3);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
    margin-bottom: 12px;
}

.stat-header i {
    font-size: 18px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 6px;
}

.stat-desc {
    font-size: 11px;
    opacity: 0.75;
}

/* Chart and Info Section */
.chart-and-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 10px 30px rgba(131, 58, 180, 0.05);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chart-container h3 {
    margin-bottom: 16px;
}

.canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.info-label i {
    width: 16px;
    text-align: center;
}

.info-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
}

/* Functional colors helper */
.text-primary { color: var(--color-primary) !important; }
.text-star { color: var(--color-star) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-info { color: var(--color-info) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* Unified Alert System */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.alert i {
    font-size: 16px;
    flex-shrink: 0;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
}
.alert-danger i {
    color: #ef4444;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}
.alert-success i {
    color: #10b981;
}

.alert-info {
    background-color: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: #67e8f9;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.1);
}
.alert-info i {
    color: #06b6d4;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
}
.alert-warning i {
    color: #f59e0b;
}

/* List Section */
.list-section {
    margin-bottom: 32px;
}

.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.list-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
}

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 36px 10px 38px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    width: 250px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--insta-pink);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(225, 48, 108, 0.15);
}

.search-clear {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.search-clear:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

/* Custom Select Dropdown */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper select {
    appearance: none;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 36px 10px 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

/* Explicit Dark Mode Option Styling for Dropdown Popups */
select option, .select-wrapper select option {
    background-color: #1a162b !important;
    color: #ffffff !important;
    padding: 10px !important;
}

select option:hover,
select option:focus,
select option:checked,
.select-wrapper select option:hover,
.select-wrapper select option:focus,
.select-wrapper select option:checked {
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--insta-pink);
    box-shadow: 0 0 15px rgba(225, 48, 108, 0.15);
}

.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Filter Info Bar */
.filter-info-bar {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    animation: slideDown 0.3s ease-out;
}

/* Data Table Styling */
.list-container {
    margin-top: 8px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

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

/* Table elements */
.avatar-cell {
    width: 60px;
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--insta-purple), var(--insta-pink), var(--insta-orange));
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(131, 58, 180, 0.3);
}

.user-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--bg-sidebar);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.username-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.name-cell {
    color: var(--text-secondary);
}

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

.action-cell {
    text-align: right;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-icon:hover {
    background: linear-gradient(45deg, var(--insta-purple), var(--insta-pink));
    border-color: transparent;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(225, 48, 108, 0.4);
}

.text-right {
    text-align: right;
}

/* Empty & Loading states */
.table-loading, .table-empty {
    text-align: center;
    padding: 64px 16px !important;
    color: var(--text-secondary);
}

.table-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(225, 48, 108, 0.1);
    border-radius: 50%;
    border-top-color: var(--insta-pink);
    animation: spin 1s ease-in-out infinite;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.empty-state i {
    font-size: 40px;
    color: var(--text-muted);
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

/* Pagination Styling */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
    animation: fadeIn 0.3s ease-out;
}

.btn-pagination {
    padding: 8px 12px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

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

.page-indicator {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
}

.items-per-page-wrapper {
    margin-left: 12px;
}

.items-per-page-wrapper select {
    padding: 8px 32px 8px 12px;
    height: 36px;
    font-size: 13px;
}

/* Responsive design */
@media (max-width: 1024px) {
    .chart-and-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: var(--transition);
        z-index: 100;
        box-shadow: none;
        border-right: 1px solid var(--border-color);
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
    }
    
    .menu-close-btn {
        display: block;
        margin-left: auto;
    }
    
    .sidebar-nav {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .nav-divider {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px 16px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header h1 {
        font-size: clamp(15px, 4.5vw, 22px) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    .header-title-container {
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    .menu-toggle-btn {
        display: block;
        font-size: 24px;
        margin-right: 16px;
        padding: 4px;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .list-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toolbar-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box, .search-box input {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .header h1 {
        font-size: clamp(13px, 4.0vw, 17px) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stats-grid .stat-card:last-child {
        grid-column: span 2;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-value {
        font-size: 28px;
    }
    .toolbar-controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }
    .search-box, .select-wrapper, .btn {
        width: 100% !important;
    }
    .search-box input, .select-wrapper select, .btn {
        width: 100% !important;
        justify-content: center;
    }
    .avatar-cell, .data-table th:first-child {
        display: none;
    }
    #btn-first-page, #btn-last-page, #btn-admin-first, #btn-admin-last {
        display: none !important;
    }
    .items-per-page-wrapper {
        display: none !important;
    }
    .page-indicator {
        min-width: auto !important;
        margin: 0 12px !important;
    }
    .pagination-controls {
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-top: 16px !important;
    }
    .action-cell {
        white-space: nowrap;
    }
    .data-table td, .data-table th {
        padding: 10px 12px;
    }
    .expiry-info-tag {
        font-size: 11px;
        line-height: 1.5;
    }
}

/* Phone Number 4-3-4 Formatting */
.phone-part {
    display: inline-block;
    margin-right: 4px;
}
.phone-part:last-child {
    margin-right: 0;
}

/* Contact Actions Layout & Jumping Prevention */
.contact-actions-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.copy-phone-btn, .btn-whatsapp {
    min-width: 84px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    justify-content: center !important;
}

@media (max-width: 768px) {
    .contact-actions-group {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    .contact-actions-group .btn,
    .contact-actions-group a.btn-whatsapp {
        width: 100% !important;
        min-width: 84px !important;
        max-width: 88px !important;
        padding: 4px 6px !important;
        font-size: 11px !important;
        justify-content: center !important;
        margin-left: 0 !important;
    }
}

@media (max-width: 576px) {
    .phone-part {
        display: block !important;
        line-height: 1.25 !important;
        margin-right: 0 !important;
    }
}

/* Modal Overlay & Guide Card */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 8, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease-out;
}
