:root {
    --bg-color: #0b0f19;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(23, 32, 54, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary-color: #38bdf8;
    --secondary-hover: #0284c7;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --pink-color: #ec4899;
    --input-bg: rgba(15, 23, 42, 0.65);
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.4), 0 4px 10px -2px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Orbs */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-color), transparent 70%);
    top: -150px;
    left: -150px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--secondary-color), transparent 70%);
    bottom: -200px;
    right: -150px;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--pink-color), transparent 70%);
    top: 30%;
    left: 45%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.15); }
}

/* Full Width Container */
.container {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem 2rem;
    box-sizing: border-box;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    animation: fadeInDown 0.6s ease-out;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Top Navigation Tabs Bar */
.nav-tabs-wrapper {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.75rem;
    flex-wrap: wrap;
}

.nav-tab-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.75rem 1.35rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    outline: none;
    user-select: none;
}

.nav-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-tab-btn.active#tab-users-btn {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.2));
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
}

.nav-tab-btn.active#tab-notifs-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.2));
    border-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

.tab-badge {
    background: rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    line-height: 1;
}

.tab-badge.notif-badge {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.45);
}

.tab-page {
    animation: fadeInUp 0.4s ease-out;
}

.tab-page.hidden {
    display: none !important;
}

/* Layout: Sidebar + Wide Table */
.main-content {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

.main-content > div {
    min-width: 0;
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease-out backwards;
}

.add-user-panel {
    animation-delay: 0.15s;
    position: sticky;
    top: 1.5rem;
}

.users-panel {
    animation-delay: 0.3s;
}

.glass-panel h2 {
    margin-bottom: 1.25rem;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
    background: rgba(15, 23, 42, 0.85);
}

/* App Offers Selector Cards */
.offers-grid-clean {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.offer-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.offer-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.offer-card input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.offer-card span {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.offer-card.tc span { color: #a78bfa; }
.offer-card.bac1 span { color: #38bdf8; }
.offer-card.bac2 span { color: #f472b6; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.5);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Table */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Custom Glass Scrollbar */
.table-container::-webkit-scrollbar {
    height: 8px;
}
.table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.4rem;
    min-width: 800px;
}

.users-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
}

.users-table td {
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.025);
    transition: all 0.2s ease;
    vertical-align: middle;
}

.users-table tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.users-table tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.users-table tr:hover td {
    background: rgba(255, 255, 255, 0.06);
}

.user-name {
    font-weight: 600;
    color: #ffffff;
}

.password-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Offer Badges */
.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0.1rem;
    letter-spacing: 0.3px;
}

.badge-tc {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-1bac {
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-2bac {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.4);
}

.badge-empty {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
}

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.suspended {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Suspended Row Styling */
tr.suspended td {
    opacity: 0.65;
}

/* Icon Action Buttons */
.actions-cell {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.btn-icon:hover {
    transform: translateY(-2px);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.copy-btn:hover { background: var(--secondary-color); color: #000; }
.edit-offers-btn:hover { background: var(--primary-color); color: #fff; }
.edit-pwd-btn:hover { background: #3b82f6; color: #fff; }
.suspend-btn:hover { background: var(--warning-color); color: #000; }
.reset-btn:hover { background: #6366f1; color: #fff; }
.delete-btn:hover { background: var(--danger-color); color: #fff; }

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem !important;
}

/* Toast Notification Popup */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    z-index: 99999;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.toast i {
    font-size: 1.25rem;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    transition: opacity 0.25s ease;
    padding: 1rem;
}

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

.modal-content {
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease-out;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 1.75rem;
}

/* Device Badge */
.device-badge {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}

.device-badge i {
    font-size: 0.85rem;
    color: #38bdf8;
    transition: color 0.2s ease;
}

.device-badge:hover {
    background: #38bdf8;
    color: #000;
    transform: translateY(-2px);
}

.device-badge:hover i {
    color: #000;
}

/* Device Badge when count > 1 (Highlighted with distinct color and badge) */
.device-badge.multiple {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.55);
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.device-badge.multiple i {
    color: #f59e0b;
}

.device-badge.multiple:hover {
    background: #f59e0b;
    color: #000;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.device-badge.multiple:hover i {
    color: #000;
}

/* Exponent / Puissance Badge (e.g. PC² or PC³) */
.device-exponent {
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    vertical-align: super;
    background: #ef4444;
    color: #ffffff;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    margin-left: 0.15rem;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    display: inline-block;
    transition: transform 0.2s ease;
}

.device-badge:hover .device-exponent {
    background: #000000;
    color: #ffffff;
    box-shadow: none;
}

/* Device Count Filter Dropdown */
.device-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.35rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.device-filter-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    user-select: none;
}

.filter-select {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--glass-border);
    color: #ffffff;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover, .filter-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.filter-select option {
    background: #0f172a;
    color: #ffffff;
    padding: 0.5rem;
}

/* User Selection Checkbox Items for Notifications */
.user-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.user-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.09);
}

.user-checkbox-item input[type="checkbox"] {
    accent-color: var(--primary-color);
    cursor: pointer;
}

.edit-notif-btn:hover { background: #3b82f6; color: #fff; }
.toggle-notif-btn:hover { background: rgba(245, 158, 11, 0.2); }
.delete-notif-btn:hover { background: var(--danger-color); color: #fff; }

/* ===================================================
   RESPONSIVE DESIGN (PC, Tablet, Mobile)
   =================================================== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 1.25rem;
    }
    .main-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .add-user-panel {
        position: static;
    }
}

/* Mobile Screens (max-width: 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0.85rem;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .header-actions .btn {
        flex: 1;
        font-size: 0.85rem;
        padding: 0.6rem;
    }

    .glass-panel {
        padding: 1rem;
        border-radius: 12px;
    }

    .users-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        justify-content: center;
    }
    
    .modal-content {
        padding: 1.25rem;
    }
}
