/* ============================================
   BASE & CONTAINER
   ============================================ */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.radar-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    overflow: hidden;
}

.radar-map {
    width: 100%;
    height: 100%;
    touch-action: pan-x pan-y;
}

/* ============================================
   SETTINGS BUTTON - Bottom Right
   ============================================ */
.btn-settings {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-settings:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.btn-settings:active {
    transform: scale(0.95);
}

/* ============================================
   MODAL OVERLAY & CONTENT
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
    padding: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #1e1e2e 0%, #2d2d44 100%);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: linear-gradient(145deg, #1e1e2e 0%, #252536 100%);
    z-index: 10;
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 17px;
    font-weight: 600;
}

.modal-header h3 i {
    margin-right: 10px;
    color: #667eea;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    transition: color 0.2s;
}

.modal-close:hover,
.modal-close:active {
    color: white;
}

.modal-body {
    padding: 16px 20px;
}

/* ============================================
   SETTINGS SECTIONS
   ============================================ */
.settings-section {
    margin-bottom: 24px;
}

.settings-section h4 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 14px 0;
}

.settings-section h4 i {
    margin-right: 8px;
    color: #667eea;
}

.setting-row {
    margin-bottom: 14px;
}

.setting-row > label:not(.toggle-label) {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 8px;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
    gap: 12px;
    position: relative;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

.toggle-label input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    pointer-events: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    overflow: hidden !important;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    flex-shrink: 0;
    transition: all 0.3s;
    order: -1;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.toggle-label input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

/* ============================================
   RANGE SLIDER
   ============================================ */
input[type="range"] {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    margin: 8px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ============================================
   COLOR PICKER
   ============================================ */
.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.color-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-item label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin: 0;
}

.color-item input[type="color"] {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
}

.color-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-item input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* ============================================
   MODAL FOOTER
   ============================================ */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    bottom: 0;
    background: linear-gradient(145deg, #252536 0%, #2d2d44 100%);
}

.footer-right {
    display: flex;
    gap: 10px;
}

.btn-profile-settings {
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-profile-settings:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.btn-reset, .btn-save {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.btn-reset:hover,
.btn-reset:active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-save:active {
    transform: scale(0.98);
}

/* ============================================
   MARKER INFO MODAL
   ============================================ */
.marker-info-modal {
    background: linear-gradient(145deg, #1e1e2e 0%, #2d2d44 100%);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.marker-info-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.marker-info-modal .modal-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.marker-info-modal .modal-body {
    padding: 16px 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.info-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 14px;
    border-radius: 10px;
}

.info-label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.info-value {
    display: block;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.status-alive {
    color: #84f522;
}

.status-dead {
    color: #f72048;
}

.info-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.info-section h4 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
}

.info-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-action {
    flex: 1;
    min-width: 90px;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-action:active {
    transform: scale(0.97);
    background: rgba(102, 126, 234, 0.3);
}

.btn-action.danger {
    background: rgba(247, 32, 72, 0.2);
    color: #f72048;
}

.btn-action.danger:active {
    background: rgba(247, 32, 72, 0.3);
}

/* ============================================
   MARKER TOOLTIP
   ============================================ */
.marker-tooltip {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 46, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1500;
    pointer-events: none;
    animation: fadeIn 0.2s ease;
    max-width: 80%;
    text-align: center;
}

/* ============================================
   LEAFLET MARKER STYLES
   ============================================ */
.radar-marker {
    background: transparent !important;
    border: none !important;
}

.radar-marker svg {
    overflow: visible;
}

.radar-marker > div {
    cursor: pointer;
}

/* ============================================
   SCROLLBAR
   ============================================ */
.modal-content::-webkit-scrollbar,
.marker-info-modal::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track,
.marker-info-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.modal-content::-webkit-scrollbar-thumb,
.marker-info-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .btn-settings {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-content,
    .marker-info-modal {
        max-height: 80vh;
        max-height: 80dvh;
        border-radius: 16px 16px 0 0;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from { 
            opacity: 0;
            transform: translateY(100%);
        }
        to { 
            opacity: 1;
            transform: translateY(0);
        }
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 14px 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    .color-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .action-buttons {
        gap: 6px;
    }

    .btn-action {
        padding: 10px 12px;
        font-size: 11px;
    }

    .marker-tooltip {
        bottom: 80px;
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .btn-settings {
        bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .modal-footer {
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .marker-tooltip {
        bottom: calc(90px + env(safe-area-inset-bottom));
    }
}

/* ============================================
   SETTINGS MODAL - TABS & SECTIONS
   ============================================ */
.settings-modal {
    max-width: 500px;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 12px;
    gap: 2px;
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn i {
    font-size: 14px;
}

.tab-content {
    animation: fadeIn 0.2s ease;
}

.section-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-group {
    transition: opacity 0.2s;
}

.settings-group.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.setting-row.inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-label.compact {
    flex: 1;
    padding: 6px 0;
    gap: 10px;
    font-size: 13px;
}

.toggle-slider.small {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.toggle-slider.small::after {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
}

.toggle-label input:checked + .toggle-slider.small::after {
    transform: translateX(18px);
}

.color-inline {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    flex-shrink: 0;
}

.color-inline::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-inline::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.label-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    flex: 1;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 14px 0;
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */
.collapsible-section {
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.collapsible-header {
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.collapsible-header:active {
    background: rgba(255, 255, 255, 0.08);
}

.collapsible-header i:first-child {
    width: 20px;
    text-align: center;
    color: #667eea;
}

.collapsible-header span {
    flex: 1;
    text-align: left;
}

.collapsible-header .chevron {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    transition: transform 0.2s;
}

.collapsible-content {
    padding: 0 16px 16px 16px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MOBILE ADJUSTMENTS FOR SETTINGS
   ============================================ */
@media (max-width: 480px) {
    .tabs-header {
        padding: 0 8px;
    }

    .tab-btn {
        padding: 10px 6px;
        font-size: 11px;
        gap: 4px;
    }
    
    .tab-btn i {
        font-size: 12px;
    }

    .collapsible-header {
        padding: 12px 14px;
        font-size: 13px;
    }

    .collapsible-content {
        padding: 0 14px 14px 14px;
    }

    .setting-row.inline {
        flex-wrap: wrap;
        gap: 8px;
    }

    .color-inline {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   ENTITY SETTINGS
   ============================================ */
.entity-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.slider-value {
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

/* ============================================
   SETTINGS SECTIONS
   ============================================ */
.settings-section {
    margin-bottom: 20px;
}

.settings-section h4 {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h4 i {
    color: #667eea;
}

/* ============================================
   DROPDOWN SELECT
   ============================================ */
.dropdown-select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-opacity='0.6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.dropdown-select:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.dropdown-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.dropdown-select option {
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.9);
    padding: 10px;
}

/* ============================================
   TEST SOUND BUTTON
   ============================================ */
.btn-test-sound {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-test-sound:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-test-sound:active {
    transform: scale(0.95);
}

/* ============================================
   LANDING PAGE
   ============================================ */
.landing-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #0a0a14;
    overflow: hidden;
}

#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.landing-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 20px;
}

.landing-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    color: white;
    margin: 0 0 10px 0;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
    letter-spacing: -2px;
}

.landing-subtitle {
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 40px 0;
    font-weight: 300;
}

.btn-landing {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.btn-landing:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.5);
}

/* ============================================
   AUTH PAGE
   ============================================ */
.auth-card {
    position: relative;
    z-index: 10;
    background: rgba(20, 20, 35, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.auth-title {
    color: white;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 30px 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
}

.auth-field input {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    transition: all 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.1);
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-error {
    background: rgba(247, 32, 72, 0.2);
    border: 1px solid rgba(247, 32, 72, 0.3);
    color: #f72048;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 10px;
}

.auth-success {
    background: rgba(132, 245, 34, 0.2);
    border: 1px solid rgba(132, 245, 34, 0.3);
    color: #84f522;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 10px;
}

.auth-notice {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #ffc107;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
    text-align: center;
}

.auth-notice i {
    margin-right: 8px;
}

.auth-back {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    margin-top: 20px;
    transition: color 0.2s;
}

.auth-back:hover {
    color: white;
}

/* ============================================
   CHANNEL SELECT
   ============================================ */
.channel-select-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a14;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.channel-select-card {
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.channel-select-card h2 {
    color: white;
    font-size: 24px;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.channel-select-card h2 i {
    color: #667eea;
}

.channel-select-card p {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 24px 0;
    font-size: 14px;
}

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.no-channels {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.no-channels i {
    font-size: 40px;
    opacity: 0.5;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.channel-item:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.channel-item i:first-child {
    color: #84f522;
}

.channel-item span {
    flex: 1;
}

.channel-item i:last-child {
    color: rgba(255, 255, 255, 0.3);
}

.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.15);
}

.channel-badge {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 35, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

.channel-badge i {
    color: #84f522;
}

/* ============================================
   PROFILE BUTTON
   ============================================ */
.btn-profile {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(30, 30, 46, 0.95);
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-profile:hover {
    background: rgba(40, 40, 60, 0.95);
    transform: scale(1.05);
}

/* ============================================
   PROFILE MODAL
   ============================================ */
.profile-modal {
    max-width: 450px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.profile-role {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-role.admin {
    color: #667eea;
}

.section-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 0 0 12px 0;
}

.api-url-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 12px;
}

.api-url-box code {
    flex: 1;
    color: #84f522;
    font-size: 11px;
    word-break: break-all;
    font-family: monospace;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-regenerate {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-regenerate:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-change-password {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 16px;
}

.btn-change-password:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.btn-admin {
    width: 100%;
    padding: 14px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-admin:hover {
    background: rgba(102, 126, 234, 0.3);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(247, 32, 72, 0.2);
    border: 1px solid rgba(247, 32, 72, 0.3);
    border-radius: 10px;
    color: #f72048;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: rgba(247, 32, 72, 0.3);
}

/* ============================================
   ADMIN PAGE
   ============================================ */
.admin-container {
    min-height: 100vh;
    background: #0a0a14;
    padding: 20px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-header h1 {
    color: white;
    font-size: 28px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header h1 i {
    color: #667eea;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
}

.admin-content {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-card {
    background: rgba(20, 20, 35, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card h2 {
    color: white;
    font-size: 18px;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card h2 i {
    color: #667eea;
}

.admin-error {
    background: rgba(247, 32, 72, 0.2);
    border: 1px solid rgba(247, 32, 72, 0.3);
    color: #f72048;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.admin-success {
    background: rgba(132, 245, 34, 0.2);
    border: 1px solid rgba(132, 245, 34, 0.3);
    color: #84f522;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-field {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.form-field input,
.form-field select {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #667eea;
}

.form-field select option {
    background: #1a1a2e;
}

.btn-create {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

/* Users Table */
.users-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 500px;
    overflow-y: auto;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 60px;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 60px;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    align-items: center;
    transition: background 0.2s;
}

.table-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.table-row.blocked > span:not(.user-actions) {
    opacity: 0.6;
}

.user-name {
    color: white;
    font-weight: 500;
}

.user-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.user-role.admin {
    color: #667eea;
}

.user-status {
    font-size: 13px;
}

.user-status.active {
    color: #84f522;
}

.user-status.blocked {
    color: #f72048;
}

.user-date {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.user-actions {
    position: relative;
    display: flex;
    justify-content: center;
}

.user-actions .btn-action {
    min-width: auto;
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
}

/* Dropdown menu */
.action-dropdown {
    position: relative;
}

.action-dropdown-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.action-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: rgba(30, 30, 45, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px;
    min-width: 160px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.action-dropdown.open .action-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 13px;
    transition: all 0.15s;
}

.action-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.action-dropdown-item i {
    width: 16px;
    text-align: center;
}

.action-dropdown-item.danger {
    color: #f72048;
}

.action-dropdown-item.danger:hover {
    background: rgba(247, 32, 72, 0.2);
}

.action-dropdown-item.warning {
    color: #ffc107;
}

.action-dropdown-item.warning:hover {
    background: rgba(255, 193, 7, 0.2);
}

.action-dropdown-item.success {
    color: #84f522;
}

.action-dropdown-item.success:hover {
    background: rgba(132, 245, 34, 0.2);
}

.action-dropdown-item.info {
    color: #3b82f6;
}

.action-dropdown-item.info:hover {
    background: rgba(59, 130, 246, 0.2);
}

.action-dropdown-item.purple {
    color: #a855f7;
}

.action-dropdown-item.purple:hover {
    background: rgba(168, 85, 247, 0.2);
}

.user-actions .btn-action.block {
    background: rgba(247, 32, 72, 0.2);
    color: #f72048;
}

.user-actions .btn-action.unblock {
    background: rgba(132, 245, 34, 0.2);
    color: #84f522;
}

.user-actions .btn-action.reset {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.user-actions .btn-action.reset:hover {
    background: rgba(255, 193, 7, 0.3);
}

.user-actions .btn-action.delete {
    background: rgba(247, 32, 72, 0.2);
    color: #f72048;
}

.user-actions .btn-action.delete:hover {
    background: rgba(247, 32, 72, 0.3);
}

.user-actions .btn-action.role {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.user-actions .btn-action.role:hover {
    background: rgba(59, 130, 246, 0.3);
}

.user-actions .btn-action.hwid {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.user-actions .btn-action.hwid:hover {
    background: rgba(168, 85, 247, 0.3);
}

/* Confirmation Modal */

.confirm-modal {
    background: linear-gradient(180deg, rgba(30, 30, 45, 0.98) 0%, rgba(20, 20, 30, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.confirm-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.confirm-icon.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.confirm-icon.danger {
    background: rgba(247, 32, 72, 0.2);
    color: #f72048;
}

.confirm-icon.info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.confirm-modal h3 {
    color: white;
    font-size: 20px;
    margin-bottom: 12px;
}

.confirm-modal p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.confirm-result {
    background: rgba(132, 245, 34, 0.1);
    border: 1px solid rgba(132, 245, 34, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.confirm-result span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.confirm-result code {
    color: #84f522;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Consolas', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-cancel {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-confirm {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-confirm.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.btn-confirm.warning:hover {
    box-shadow: 0 5px 20px rgba(255, 193, 7, 0.4);
}

.btn-confirm.danger {
    background: linear-gradient(135deg, #f72048 0%, #dc3545 100%);
}

.btn-confirm.danger:hover {
    box-shadow: 0 5px 20px rgba(247, 32, 72, 0.4);
}

.btn-confirm.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-confirm.info:hover {
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

/* Users header with add button */
.users-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.users-header h2 {
    margin: 0;
}

.btn-add-user {
    display: flex;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-add-user:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Dropup - menu opens upward */
.action-dropdown.dropup .action-dropdown-menu {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

/* Create user modal form */
.create-user-modal {
    text-align: left;
}

.create-user-modal h3 {
    text-align: center;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-field label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-transform: uppercase;
}

.modal-field input,
.modal-field select {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 14px;
}

.modal-field input:focus,
.modal-field select:focus {
    outline: none;
    border-color: #667eea;
}

.modal-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.modal-message.error {
    background: rgba(247, 32, 72, 0.2);
    color: #f72048;
}

.modal-message.success {
    background: rgba(132, 245, 34, 0.2);
    color: #84f522;
}

@media (max-width: 768px) {
    .table-header {
        display: none;
    }

    .table-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 16px;
        position: relative;
    }

    .table-row .user-name {
        grid-column: 1 / -1;
        font-size: 16px;
        font-weight: 600;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 4px;
    }

    .table-row .user-role,
    .table-row .user-status,
    .table-row .user-date {
        font-size: 12px;
    }

    .table-row .user-role::before {
        content: "Role: ";
        color: rgba(255, 255, 255, 0.4);
    }

    .table-row .user-status::before {
        content: "Status: ";
        color: rgba(255, 255, 255, 0.4);
    }

    .table-row .user-date::before {
        content: "Created: ";
        color: rgba(255, 255, 255, 0.4);
    }

    .table-row .user-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .action-dropdown-menu {
        right: 0;
        left: auto;
    }

    .admin-container {
        padding: 15px;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .users-table {
        max-height: calc(100vh - 220px);
        max-height: calc(100dvh - 220px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .admin-card {
        margin-bottom: 15px;
    }

    /* All dropdowns open upward on mobile by default */
    .action-dropdown .action-dropdown-menu {
        top: auto;
        bottom: 100%;
        margin-top: 0;
        margin-bottom: 4px;
    }

    /* First items dropdown opens downward */
    .action-dropdown:not(.dropup) .action-dropdown-menu {
        top: 100%;
        bottom: auto;
        margin-top: 4px;
        margin-bottom: 0;
    }

    .action-dropdown.dropup .action-dropdown-menu {
        top: auto;
        bottom: 100%;
        margin-top: 0;
        margin-bottom: 4px;
    }
}

/* ============================================
   PROFILE MODAL - TABBED VERSION
   ============================================ */
.profile-info-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 16px;
    margin-bottom: 20px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

.profile-details-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.profile-name-large {
    color: white;
    font-size: 24px;
    font-weight: 600;
}

.profile-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-role-badge.admin {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.profile-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.stat-value.mono {
    font-family: monospace;
    font-size: 13px;
}

.btn-admin-large {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-admin-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* API Tab */
.api-section {
    margin-bottom: 24px;
}

.api-section:last-child {
    margin-bottom: 0;
}

.api-section h4 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-section h4 i {
    color: #667eea;
}

.api-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.api-url-box {
    padding: 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.api-url-box code {
    color: #84f522;
    font-size: 12px;
    word-break: break-all;
    font-family: 'Consolas', 'Monaco', monospace;
}

.api-token-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.api-token-box code {
    flex: 1;
    color: #ffd700;
    font-size: 13px;
    word-break: break-all;
    font-family: 'Consolas', 'Monaco', monospace;
}

.api-warning {
    color: rgba(255, 200, 50, 0.8);
    font-size: 12px;
    margin: 12px 0 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Security Tab */
.security-section h4 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.security-section h4 i {
    color: #667eea;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(247, 32, 72, 0.15);
    border: 1px solid rgba(247, 32, 72, 0.3);
    color: #f72048;
}

.alert-success {
    background: rgba(132, 245, 34, 0.15);
    border: 1px solid rgba(132, 245, 34, 0.3);
    color: #84f522;
}

/* Last used channel badge */
.channel-item.last-used {
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(102, 126, 234, 0.1);
}

.last-badge {
    font-size: 10px;
    padding: 3px 8px;
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   CHANNEL SELECT - HEADER & PROFILE
   ============================================ */
.channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.channel-header h2 {
    margin: 0;
}

.btn-profile-small {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-profile-small:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ============================================
   ADMIN TABS
   ============================================ */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.admin-tab {
    flex: 1;
    max-width: 200px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.admin-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

.admin-tab.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.4);
    color: white;
}

.admin-tab.active i {
    color: #667eea;
}

/* ============================================
   ACTIVITY LOGS
   ============================================ */
.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.log-header h2 {
    margin: 0;
}

.log-filters select {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.log-filters select option {
    background: #1a1a2e;
}

.log-filter-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    margin-bottom: 16px;
}

.log-filter-badge span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.log-filter-badge button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.log-filter-badge button:hover {
    color: white;
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.no-logs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.no-logs i {
    font-size: 40px;
    opacity: 0.5;
}

.log-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    transition: background 0.2s;
}

.log-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.log-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.log-login .log-icon {
    background: rgba(132, 245, 34, 0.15);
    color: #84f522;
}

.log-channel .log-icon {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.log-api-connect .log-icon {
    background: rgba(255, 200, 50, 0.15);
    color: #ffc832;
}

.log-api-disconnect .log-icon {
    background: rgba(247, 32, 72, 0.15);
    color: #f72048;
}

.log-content {
    flex: 1;
    min-width: 0;
}

.log-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.log-user {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.log-action {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.log-details {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-top: 4px;
    font-family: monospace;
}

.log-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* User actions - logs button */
.user-actions .btn-action.logs {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.user-actions .btn-action.logs:hover {
    background: rgba(102, 126, 234, 0.3);
}

@media (max-width: 600px) {
    .log-item {
        flex-wrap: wrap;
    }
    
    .log-time {
        width: 100%;
        margin-top: 8px;
        padding-left: 54px;
    }
}

/* ============================================
   BLOCKED OVERLAY
   ============================================ */
.blocked-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.blocked-card {
    text-align: center;
    padding: 50px;
    max-width: 400px;
}

.blocked-card i.fa-ban {
    font-size: 80px;
    color: #f72048;
    margin-bottom: 24px;
    display: block;
}

.blocked-card h2 {
    color: white;
    font-size: 28px;
    margin: 0 0 12px 0;
}

.blocked-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

.btn-logout-blocked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: rgba(247, 32, 72, 0.2);
    border: 1px solid rgba(247, 32, 72, 0.4);
    border-radius: 12px;
    color: #f72048;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-logout-blocked:hover {
    background: rgba(247, 32, 72, 0.3);
}

/* ============================================
   PROFILE MODAL - COMPACT HEADER
   ============================================ */
.profile-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar-small {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.profile-header-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.profile-header-badge {
    padding: 4px 10px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    color: #667eea;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-admin-footer {
    padding: 12px 20px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-admin-footer:hover {
    background: rgba(102, 126, 234, 0.25);
}

.profile-modal .modal-footer {
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.notification {
    background: rgba(30, 30, 40, 0.95);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: notification-slide-in 0.3s ease-out;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification.removing {
    animation: notification-slide-out 0.3s ease-in forwards;
}

@keyframes notification-slide-in {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes notification-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
    word-wrap: break-word;
}

.notification-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.notification-close:hover {
    color: rgba(255, 255, 255, 0.9);
}

.notification-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    transform-origin: left;
    animation: notification-progress var(--duration) linear forwards;
}

@keyframes notification-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Notification Types */
.notification-info {
    border-left: 4px solid #3b82f6;
}

.notification-info .notification-icon {
    color: #3b82f6;
}

.notification-info .notification-progress {
    background: rgba(59, 130, 246, 0.6);
}

.notification-success {
    border-left: 4px solid #22c55e;
}

.notification-success .notification-icon {
    color: #22c55e;
}

.notification-success .notification-progress {
    background: rgba(34, 197, 94, 0.6);
}

.notification-warning {
    border-left: 4px solid #f59e0b;
}

.notification-warning .notification-icon {
    color: #f59e0b;
}

.notification-warning .notification-progress {
    background: rgba(245, 158, 11, 0.6);
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-error .notification-icon {
    color: #ef4444;
}

.notification-error .notification-progress {
    background: rgba(239, 68, 68, 0.6);
}

/* Mobile */
@media (max-width: 480px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
    }

    .notification-content {
        padding: 12px 14px;
    }

    .notification-message {
        font-size: 13px;
    }
}

/* ============================================
   VIEWER MANAGEMENT
   ============================================ */
.viewer-section {
    margin-bottom: 24px;
}

.viewer-section:last-child {
    margin-bottom: 0;
}

.viewer-section h4 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewer-section h4 i {
    color: #667eea;
}

.share-token-box {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.share-token {
    color: #667eea !important;
    font-size: 18px !important;
    letter-spacing: 2px;
    font-weight: 600;
}

.token-note {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 8px 0 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.token-note i {
    color: #667eea;
}

.add-viewer-row {
    display: flex;
    gap: 10px;
}

.viewer-input {
    flex: 1;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.viewer-input:focus {
    outline: none;
    border-color: #667eea;
}

.viewer-input::placeholder {
    text-transform: none;
    letter-spacing: normal;
    color: rgba(255, 255, 255, 0.3);
}

.btn-add-viewer {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-add-viewer:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.btn-add-viewer:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.no-viewers {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.viewers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.viewer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: background 0.2s;
}

.viewer-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.viewer-item i:first-child {
    color: #667eea;
}

.viewer-item span {
    flex: 1;
    color: white;
    font-size: 14px;
}

.btn-remove-viewer {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(247, 32, 72, 0.15);
    color: #f72048;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove-viewer:hover {
    background: rgba(247, 32, 72, 0.25);
}

/* ============================================
   GUEST LINKS
   ============================================ */
.guest-link-create {
    display: flex;
    gap: 10px;
}

.duration-select {
    flex: 1;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.duration-select option {
    background: #1a1a2e;
}

.duration-select:focus {
    outline: none;
    border-color: #667eea;
}

.guest-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.guest-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: background 0.2s;
}

.guest-link-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.guest-link-item.expired {
    opacity: 0.5;
}

.guest-link-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.guest-link-token {
    color: #84f522;
    font-size: 12px;
    font-family: 'Consolas', monospace;
}

.guest-link-expires {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.guest-link-expires i {
    color: #ffc107;
}

.expired-badge {
    color: #f72048;
    font-weight: 500;
}

.forever-badge {
    color: #667eea;
    font-weight: 500;
}

.guest-link-actions {
    display: flex;
    gap: 6px;
}

.btn-copy-small {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-copy-small:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ============================================
   WATCH PAGE (GUEST)
   ============================================ */
.watch-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a14;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.loading-spinner {
    font-size: 48px;
    color: #667eea;
}

.watch-loading p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.watch-error {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a14;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-card {
    text-align: center;
    max-width: 400px;
}

.error-card i:first-child {
    font-size: 80px;
    color: #f72048;
    margin-bottom: 24px;
    display: block;
}

.error-card.expired i:first-child {
    color: #ffc107;
}

.error-card h2 {
    color: white;
    font-size: 28px;
    margin: 0 0 12px 0;
}

.error-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.guest-badge {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.guest-badge i:first-child {
    color: #84f522;
}

.guest-badge .time-left {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffc107;
}

.guest-badge .time-left i {
    font-size: 12px;
}

.guest-settings-btn {
    margin-left: 8px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.guest-settings-btn:hover {
    background: rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

/* ============================================
   ADMIN - MANAGE VIEWERS MODAL
   ============================================ */
.manage-viewers-modal {
    text-align: left;
    max-width: 450px;
}

.manage-viewers-modal h3,
.manage-viewers-modal p {
    text-align: center;
}

.viewers-admin-section {
    margin: 20px 0;
}

.add-viewer-admin {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.viewer-select {
    flex: 1;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.viewer-select option {
    background: #1a1a2e;
}

.viewer-select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-add-viewer-admin {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-add-viewer-admin:hover {
    transform: scale(1.05);
}

.viewers-admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.no-viewers-admin {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.viewer-admin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.viewer-admin-item i:first-child {
    color: #667eea;
}

.viewer-admin-item span {
    flex: 1;
    color: white;
    font-size: 14px;
}

/* ============================================
   ADMIN - PERMISSIONS MODAL
   ============================================ */
.permissions-modal {
    text-align: left;
    max-width: 450px;
}

.permissions-modal h3,
.permissions-modal p {
    text-align: center;
}

.permissions-list {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.permission-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.permission-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.permission-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: 0.3s;
}

.permission-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: 0.3s;
}

.permission-toggle input:checked + .permission-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.permission-toggle input:checked + .permission-slider::before {
    transform: translateX(22px);
    background: white;
}

.permission-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.permission-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.permission-name i {
    color: #667eea;
    font-size: 12px;
    width: 16px;
}

.permission-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* ============================================
   ADMIN - GUEST LINKS MODAL
   ============================================ */
.guest-links-modal {
    text-align: left;
    max-width: 500px;
}

.guest-links-modal h3,
.guest-links-modal p {
    text-align: center;
}

.guest-links-admin-section {
    margin: 20px 0;
}

.add-guest-link-admin {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.duration-select {
    flex: 1;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.duration-select option {
    background: #1a1a2e;
}

.duration-select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-add-link-admin {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-add-link-admin:hover {
    transform: scale(1.02);
}

.guest-links-admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.no-links-admin {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.guest-link-admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.guest-link-admin-item.expired {
    opacity: 0.5;
}

.guest-link-admin-item.inactive {
    opacity: 0.5;
}

.link-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.link-token {
    font-family: monospace;
    font-size: 13px;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
}

.link-status {
    font-size: 12px;
}

.status-expired {
    color: #f72048;
}

.status-inactive {
    color: rgba(255, 255, 255, 0.4);
}

.status-expires {
    color: #ffc107;
}

.status-forever {
    color: #84f522;
}

.link-actions {
    display: flex;
    gap: 8px;
}

.btn-copy-link,
.btn-delete-link {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-copy-link {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.btn-copy-link:hover {
    background: rgba(102, 126, 234, 0.3);
}

.btn-delete-link {
    background: rgba(247, 32, 72, 0.2);
    color: #f72048;
}

.btn-delete-link:hover {
    background: rgba(247, 32, 72, 0.3);
}

/* ============================================
   TOTP 2FA STYLES
   ============================================ */
.totp-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.totp-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.totp-status.enabled {
    background: rgba(132, 245, 34, 0.1);
    border: 1px solid rgba(132, 245, 34, 0.3);
    color: #84f522;
}

.totp-status.disabled {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

.totp-status i {
    font-size: 18px;
}

.backup-codes-remaining {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.7;
}

.btn-enable-totp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-enable-totp:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-enable-totp:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.totp-setup {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.totp-qr-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    margin: 16px 0;
}

.totp-qr {
    width: 180px;
    height: 180px;
}

.totp-secret-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 20px;
}

.secret-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 0;
    white-space: nowrap;
}

.totp-secret {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
    color: #667eea;
    letter-spacing: 2px;
    word-break: break-all;
}

.totp-backup-codes {
    background: rgba(255, 200, 50, 0.1);
    border: 1px solid rgba(255, 200, 50, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.backup-label {
    color: #ffc832;
    font-size: 13px;
    font-weight: 500;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.backup-code {
    font-family: monospace;
    font-size: 13px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    text-align: center;
    color: white;
}

.backup-copy {
    width: 100%;
    justify-content: center;
    padding: 10px !important;
    background: rgba(255, 200, 50, 0.2) !important;
    color: #ffc832 !important;
}

.backup-copy:hover {
    background: rgba(255, 200, 50, 0.3) !important;
}

.totp-verify {
    margin-top: 20px;
}

.totp-verify-row,
.totp-disable-row {
    display: flex;
    gap: 12px;
}

.totp-code-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 20px;
    font-family: monospace;
    text-align: center;
    letter-spacing: 6px;
}

.totp-code-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
}

.totp-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 14px;
}

.totp-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
}

.btn-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(132, 245, 34, 0.2);
    border: 1px solid rgba(132, 245, 34, 0.4);
    border-radius: 10px;
    color: #84f522;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-success:hover:not(:disabled) {
    background: rgba(132, 245, 34, 0.3);
}

.btn-success:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(247, 32, 72, 0.2);
    border: 1px solid rgba(247, 32, 72, 0.4);
    border-radius: 10px;
    color: #f72048;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(247, 32, 72, 0.3);
}

.btn-danger:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-cancel-setup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-setup:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   SECURITY LOG TYPES
   ============================================ */
/* Security failure logs */
.log-security-fail .log-icon {
    background: rgba(247, 32, 72, 0.15);
    color: #f72048;
}

/* Security success logs (TOTP, backup codes) */
.log-security .log-icon {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

/* Admin positive actions (create, unblock) */
.log-admin-positive .log-icon {
    background: rgba(132, 245, 34, 0.15);
    color: #84f522;
}

/* Admin negative actions (delete, block) */
.log-admin-negative .log-icon {
    background: rgba(247, 32, 72, 0.15);
    color: #f72048;
}

/* Admin neutral actions (reset, change) */
.log-admin .log-icon {
    background: rgba(255, 200, 50, 0.15);
    color: #ffc832;
}
