/* MATRIXDESK - AUTH & USER MANAGEMENT STYLES
   - Scoped with .auth-* and .user-mgmt-*
   - Glassmorphic, Modern & Dark Theme Responsive
*/

/* 1. Unified Auth Modal & Tabs */
.auth-modal-overlay,
#authModal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999 !important;
    background: linear-gradient(135deg, rgba(6, 12, 24, 0.3) 0%, rgba(4, 8, 16, 0.45) 100%), url('../Login%20Pge%20Image.png?v=20260815_v4') center/cover no-repeat fixed !important;
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-y: auto;
    box-sizing: border-box;
}
.auth-modal-overlay.active,
#authModal.active {
    display: flex !important;
}

.auth-card {
    background: rgba(8, 18, 36, 0.42) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border: 1px solid rgba(0, 229, 255, 0.45) !important;
    border-radius: 18px !important;
    padding: 20px 22px 16px 22px !important;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 35px rgba(0, 229, 255, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
    position: relative;
    animation: authCardPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    color: #e2e8f0;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.auth-card::-webkit-scrollbar {
    width: 4px;
}

.auth-card::-webkit-scrollbar-track {
    background: rgba(4, 12, 26, 0.3);
}

.auth-card::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.35);
    border-radius: 4px;
}

.auth-card::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.65);
}

@keyframes authCardPop {
    0% { opacity: 0; transform: scale(0.94) translateY(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-logo-img {
    max-width: 85%;
    width: auto;
    height: 55px;
    max-height: 55px !important;
    display: block;
    margin: 0 auto 12px auto !important;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(0, 229, 255, 0.35));
}

.auth-tab-header {
    display: flex;
    background: rgba(4, 12, 26, 0.5);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    font-size: 13.5px;
    font-weight: 700;
    padding: 7px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.auth-tab-btn.active {
    background: linear-gradient(135deg, #00e5ff 0%, #0284c7 100%);
    color: #040d1a;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.35);
}

.auth-form-group {
    margin-bottom: 10px;
    text-align: left;
}

.auth-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input {
    width: 100%;
    height: 38px;
    background: rgba(4, 12, 26, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: #ffffff !important;
    border: 1px solid rgba(0, 229, 255, 0.25) !important;
    border-radius: 9px !important;
    padding: 8px 12px !important;
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: #00e5ff !important;
    background: rgba(4, 12, 26, 0.6) !important;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.auth-photo-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-avatar-preview {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    border: 2px solid #00e5ff;
    object-fit: cover;
    background: #0b101e;
}

.auth-photo-row input[type="file"].auth-input {
    height: 36px;
    padding: 4px 8px !important;
    font-size: 12px;
    line-height: 24px;
}

.auth-btn-submit {
    width: 100%;
    height: 40px;
    background: linear-gradient(135deg, #00e5ff 0%, #00ff73 100%);
    color: #040d1a;
    border: none;
    font-weight: 800;
    font-size: 14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 18px rgba(0, 229, 255, 0.35);
    transition: all 0.25s ease;
}

.auth-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 115, 0.45);
}

.auth-alert-banner {
    display: none;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.35;
    text-align: center;
}
.auth-alert-banner.info {
    display: block;
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid #00e5ff;
    color: #00e5ff;
}
.auth-alert-banner.error {
    display: block;
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid #ff4757;
    color: #ff4757;
}
.auth-alert-banner.success {
    display: block;
    background: rgba(0, 255, 115, 0.15);
    border: 1px solid #00ff73;
    color: #00ff73;
}

/* 2. Admin Header Notification Bell & Alerts Dropdown */
.admin-notif-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.admin-notif-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border, #2e3b52);
    color: var(--text-main, #e2e8f0);
    padding: 7px 11px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-notif-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: #00e5ff;
}

.admin-notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4757;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.5);
    animation: notifPulse 1.8s infinite;
}

@keyframes notifPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.admin-notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--panel-bg, #151b2b);
    border: 1px solid var(--panel-border, #2e3b52);
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow-y: auto;
    padding: 12px;
}
.admin-notif-dropdown.active {
    display: block !important;
}

.admin-notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border, #2e3b52);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main, #e2e8f0);
}

.admin-notif-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border, #2e3b52);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.admin-notif-item:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: #00e5ff;
}

.admin-notif-user-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-notif-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--accent-blue, #00e5ff);
}

/* 3. System > User Management Subtabs */
.user-mgmt-top-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border, #2e3b52);
    padding-bottom: 12px;
}

.user-mgmt-tab-btn {
    background: var(--panel-bg, #101828) !important;
    border: 1px solid var(--border, #2e3b52) !important;
    color: var(--text-muted, #94a3b8) !important;
    padding: 8px 18px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
}

.user-mgmt-tab-btn:hover {
    background: rgba(0, 229, 255, 0.1) !important;
    color: var(--accent-blue, #00e5ff) !important;
    border-color: var(--accent-blue, #00e5ff) !important;
}

.user-mgmt-tab-btn.active {
    background: var(--accent-blue, #00e5ff) !important;
    color: #040d1a !important;
    border-color: var(--accent-blue, #00e5ff) !important;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3) !important;
}

.user-mgmt-badge-pill {
    background: #ff4757;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
}

.um-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.um-filter-bar input[type="text"] {
    flex: 2;
    min-width: 240px;
    padding: 10px 14px;
    background: var(--bg-dark, #0b101e);
    border: 1px solid var(--border, #2e3b52);
    color: var(--text-main, #e2e8f0);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.um-filter-bar select {
    flex: 1;
    min-width: 160px;
    padding: 10px 14px;
    background: var(--bg-dark, #0b101e);
    border: 1px solid var(--border, #2e3b52);
    color: var(--text-main, #e2e8f0);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.user-mgmt-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.user-mgmt-status-badge.approved, .user-mgmt-status-badge.active {
    background: rgba(0, 255, 115, 0.15);
    color: #00ff73;
    border: 1px solid #00ff73;
}
.user-mgmt-status-badge.pending {
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    border: 1px solid #00e5ff;
}
.user-mgmt-status-badge.hold {
    background: rgba(255, 165, 2, 0.15);
    color: #ffa502;
    border: 1px solid #ffa502;
}
.user-mgmt-status-badge.declined, .user-mgmt-status-badge.locked, .user-mgmt-status-badge.disabled {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border: 1px solid #ff4757;
}

/* 4. Granular Permission Modal */
.user-perm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.user-perm-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border, #2e3b52);
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-perm-item:hover {
    border-color: var(--accent-blue, #00e5ff);
    background: rgba(0, 229, 255, 0.05);
}

.user-perm-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00e5ff;
}

.admin-btn-action {
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.admin-btn-approve {
    background: rgba(0, 255, 115, 0.15);
    color: #00ff73;
    border: 1px solid #00ff73;
}
.admin-btn-approve:hover {
    background: #00ff73;
    color: #040d1a;
}
.admin-btn-hold {
    background: rgba(255, 165, 2, 0.15);
    color: #ffa502;
    border: 1px solid #ffa502;
}
.admin-btn-hold:hover {
    background: #ffa502;
    color: #040d1a;
}
.admin-btn-decline {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border: 1px solid #ff4757;
}
.admin-btn-decline:hover {
    background: #ff4757;
    color: #ffffff;
}

/* 5. Short-Screen Media Query */
@media (max-height: 750px) {
    .auth-modal-overlay,
    #authModal {
        padding: 8px;
    }
    .auth-card {
        padding: 15px 18px 12px 18px !important;
        max-width: 350px;
        margin: 0 auto;
        max-height: calc(100vh - 16px);
        border-radius: 14px !important;
    }
    .auth-logo-img {
        height: 46px;
        max-height: 46px !important;
        margin-bottom: 8px !important;
    }
    .auth-tab-header {
        margin-bottom: 8px;
        padding: 2px;
    }
    .auth-tab-btn {
        padding: 5px 0;
        font-size: 12.5px;
    }
    .auth-form-group {
        margin-bottom: 7px;
    }
    .auth-form-group label {
        font-size: 10px;
        margin-bottom: 2px;
    }
    .auth-input {
        height: 34px;
        padding: 6px 10px !important;
        font-size: 13px;
        border-radius: 7px !important;
    }
    .auth-photo-row {
        gap: 8px;
    }
    .auth-avatar-preview {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    .auth-photo-row input[type="file"].auth-input {
        height: 32px;
        padding: 4px 6px !important;
        font-size: 11px;
        line-height: 22px;
    }
    .auth-btn-submit {
        height: 36px;
        font-size: 13px;
        margin-top: 8px;
        border-radius: 7px;
    }
    .login-footer-links {
        margin-top: 8px !important;
        font-size: 11.5px;
    }
}

