/* =========================================================
   GRAPHIADDA
   ADMIN PANEL CSS
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;

    background:
        radial-gradient(
            circle at 10% 5%,
            rgba(109, 93, 252, 0.14),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(36, 186, 242, 0.08),
            transparent 30%
        ),
        #060a15;

    color: #ffffff;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


/* =========================================================
   NAVBAR
   ========================================================= */

.admin-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.07);

    background:
        rgba(6, 10, 21, 0.90);

    backdrop-filter: blur(18px);
}

.admin-nav-inner {
    width: min(1120px, calc(100% - 28px));
    min-height: 68px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: #ffffff;
    text-decoration: none;
}

.admin-brand-icon {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #6d5dfc,
            #24baf2
        );

    font-size: 18px;
}

.admin-brand-name {
    font-size: 18px;
    font-weight: 900;
}

.admin-brand-name span {
    color: #8f83ff;
}

.admin-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 5px 8px;

    border-radius: 999px;

    background:
        rgba(34, 197, 94, 0.08);

    color: #86efac;

    font-size: 7px;
    font-weight: 850;
}

.logout-btn {
    min-height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 0 11px;

    border:
        1px solid rgba(239, 68, 68, 0.24);

    border-radius: 8px;

    background:
        rgba(239, 68, 68, 0.05);

    color: #fca5a5;

    cursor: pointer;

    font-size: 8px;
    font-weight: 800;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.logout-btn:hover {
    background:
        rgba(239, 68, 68, 0.10);

    transform: translateY(-1px);
}

.logout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* =========================================================
   PAGE
   ========================================================= */

.admin-page {
    width: min(1120px, calc(100% - 28px));

    margin: 0 auto;

    padding: 42px 0 65px;
}


/* =========================================================
   LOADING
   ========================================================= */

.loading-screen {
    min-height:
        calc(100vh - 69px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;
}

.loading-card {
    width: min(430px, 100%);

    padding: 30px;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 17px;

    background:
        rgba(255, 255, 255, 0.025);

    text-align: center;

    box-shadow:
        0 20px 70px rgba(0, 0, 0, 0.25);
}

.spinner {
    width: 35px;
    height: 35px;

    margin: 0 auto 15px;

    border:
        3px solid rgba(255, 255, 255, 0.10);

    border-top-color: #8f83ff;

    border-radius: 50%;

    animation:
        adminSpin 0.8s linear infinite;
}

@keyframes adminSpin {
    to {
        transform: rotate(360deg);
    }
}

.loading-card h2 {
    margin-bottom: 6px;
    font-size: 16px;
}

.loading-card p {
    color: #64748b;
    font-size: 9px;
    line-height: 1.7;
}


/* =========================================================
   ACCESS DENIED
   ========================================================= */

.denied-screen {
    min-height:
        calc(100vh - 69px);

    display: none;

    align-items: center;
    justify-content: center;

    padding: 25px;
}

.denied-card {
    width: min(500px, 100%);

    padding: 32px;

    border:
        1px solid rgba(239, 68, 68, 0.18);

    border-radius: 18px;

    background:
        rgba(239, 68, 68, 0.035);

    text-align: center;
}

.denied-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;

    background:
        rgba(239, 68, 68, 0.09);

    color: #f87171;

    font-size: 28px;
}

.denied-card h1 {
    margin-bottom: 8px;
    font-size: 25px;
}

.denied-card p {
    color: #718097;
    font-size: 10px;
    line-height: 1.8;
}

.back-dashboard {
    min-height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    margin-top: 17px;

    padding: 0 13px;

    border-radius: 9px;

    background:
        linear-gradient(
            135deg,
            #6d5dfc,
            #24baf2
        );

    color: #ffffff;

    text-decoration: none;

    font-size: 8px;
    font-weight: 850;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.back-dashboard:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 30px rgba(36, 186, 242, 0.15);
}


/* =========================================================
   ADMIN APP
   ========================================================= */

.admin-app {
    display: none;
}


/* =========================================================
   HERO
   ========================================================= */

.admin-hero {
    margin-bottom: 22px;
}

.admin-badge {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 7px 10px;

    border:
        1px solid rgba(139, 124, 255, 0.24);

    border-radius: 999px;

    background:
        rgba(109, 93, 252, 0.07);

    color: #b9b1ff;

    font-size: 7px;
    font-weight: 850;

    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-hero h1 {
    margin: 15px 0 7px;

    font-size:
        clamp(32px, 6vw, 52px);

    line-height: 1.04;

    letter-spacing: -0.055em;

    font-weight: 950;
}

.admin-gradient {
    background:
        linear-gradient(
            90deg,
            #9b8dff,
            #5eafff,
            #24baf2
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}

.admin-hero p {
    max-width: 680px;

    color: #718097;

    font-size: 10px;
    line-height: 1.8;
}


/* =========================================================
   STATS
   ========================================================= */

.admin-stats {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;

    margin-bottom: 12px;
}

.stat-card {
    padding: 18px;

    border:
        1px solid rgba(255, 255, 255, 0.07);

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.025);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);

    border-color:
        rgba(139, 124, 255, 0.20);
}

.stat-icon {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 10px;

    border-radius: 10px;

    background:
        rgba(109, 93, 252, 0.09);

    color: #a79fff;

    font-size: 17px;
}

.stat-value {
    display: block;

    margin-bottom: 3px;

    color: #ffffff;

    font-size: 21px;
    font-weight: 900;
}

.stat-label {
    color: #64748b;

    font-size: 8px;
    font-weight: 700;
}


/* =========================================================
   ADMIN CARDS
   ========================================================= */

.admin-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;
}

.admin-card {
    padding: 20px;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            rgba(17, 26, 45, 0.97),
            rgba(9, 15, 29, 0.97)
        );

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.admin-card:hover {
    transform: translateY(-3px);

    border-color:
        rgba(139, 124, 255, 0.20);

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.18);
}

.admin-card-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 12px;

    border-radius: 11px;

    background:
        rgba(109, 93, 252, 0.10);

    color: #a79fff;

    font-size: 18px;
}

.admin-card h3 {
    margin-bottom: 5px;

    font-size: 13px;
    font-weight: 850;
}

.admin-card p {
    color: #64748b;

    font-size: 8px;
    line-height: 1.7;
}


/* =========================================================
   ADMIN PROFILE
   ========================================================= */

.admin-profile {
    margin-top: 12px;

    padding: 20px;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 15px;

    background:
        rgba(255, 255, 255, 0.025);
}

.profile-heading {
    display: flex;
    align-items: center;

    gap: 9px;

    margin-bottom: 15px;
}

.profile-heading-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background:
        rgba(109, 93, 252, 0.09);

    color: #a79fff;

    font-size: 16px;
}

.profile-heading h2 {
    margin-bottom: 2px;
    font-size: 14px;
}

.profile-heading p {
    color: #536078;
    font-size: 7px;
}

.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 11px 0;

    border-top:
        1px solid rgba(255, 255, 255, 0.05);
}

.profile-label {
    color: #536078;

    font-size: 8px;
    font-weight: 700;
}

.profile-value {
    color: #dbe4f0;

    font-size: 9px;
    font-weight: 750;

    text-align: right;

    word-break: break-word;
}

.role-badge {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    padding: 5px 8px;

    border-radius: 999px;

    background:
        rgba(34, 197, 94, 0.08);

    color: #86efac;

    font-size: 7px;
    font-weight: 850;
}


/* =========================================================
   STATUS MESSAGE
   ========================================================= */

.admin-status {
    display: none;

    margin-top: 12px;

    padding: 10px 12px;

    border-radius: 8px;

    font-size: 8px;
}

.admin-status.show {
    display: block;
}

.admin-status[data-type="success"] {
    background:
        rgba(34, 197, 94, 0.07);

    border:
        1px solid rgba(34, 197, 94, 0.15);

    color: #86efac;
}

.admin-status[data-type="error"] {
    background:
        rgba(239, 68, 68, 0.07);

    border:
        1px solid rgba(239, 68, 68, 0.15);

    color: #fca5a5;
}


/* =========================================================
   FOOTER
   ========================================================= */

.admin-footer {
    margin-top: 35px;

    padding-top: 19px;

    border-top:
        1px solid rgba(255, 255, 255, 0.06);

    color: #3f4a5e;

    text-align: center;

    font-size: 8px;
}


/* =========================================================
   SELECTION
   ========================================================= */

::selection {
    background: rgba(109, 93, 252, 0.35);
    color: #ffffff;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #060a15;
}

::-webkit-scrollbar-thumb {
    background: #202a40;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #303c59;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {

    .admin-stats,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-page {
        padding-top: 32px;
    }

}


@media (max-width: 500px) {

    .admin-page {
        width: calc(100% - 18px);
    }

    .admin-label {
        display: none;
    }

    .admin-brand-name {
        font-size: 16px;
    }

    .profile-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-value {
        text-align: left;
    }

    .admin-hero h1 {
        font-size: 34px;
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}


/* =========================================================
   USER MANAGEMENT
   ========================================================= */

.user-management {
    margin-top: 12px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 15px;
    background: linear-gradient(
        145deg,
        rgba(17,26,45,.97),
        rgba(9,15,29,.97)
    );
}

.management-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
}

.management-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: #8f83ff;
    font-size: 7px;
    font-weight: 850;
    letter-spacing: .05em;
}

.management-head h2 {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 900;
}

.management-head p {
    max-width: 650px;
    margin: 0;
    color: #64748b;
    font-size: 8px;
    line-height: 1.7;
}

.refresh-users-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 11px;
    border: 1px solid rgba(139,124,255,.22);
    border-radius: 8px;
    background: rgba(109,93,252,.07);
    color: #b9b1ff;
    cursor: pointer;
    font-size: 8px;
    font-weight: 800;
}

.refresh-users-btn:hover {
    background: rgba(109,93,252,.12);
}

.refresh-users-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.user-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.user-search {
    flex: 1;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 9px;
    background: rgba(255,255,255,.025);
    color: #67758c;
}

.user-search:focus-within {
    border-color: rgba(139,124,255,.25);
}

.user-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #dbe4f0;
    font: inherit;
    font-size: 9px;
}

.user-search input::placeholder {
    color: #4e5b72;
}

.user-list-status {
    min-width: 90px;
    color: #536078;
    text-align: right;
    font-size: 7px;
    font-weight: 750;
}

.user-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 11px;
}

.user-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

.user-table th,
.user-table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    text-align: left;
    vertical-align: middle;
}

.user-table th {
    background: rgba(255,255,255,.025);
    color: #627087;
    font-size: 7px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.user-table td {
    color: #cbd5e1;
    font-size: 8px;
}

.user-table tr:last-child td {
    border-bottom: 0;
}

.user-name {
    color: #eef2f7;
    font-weight: 750;
}

.user-email {
    color: #91a0b5;
}

.user-uid {
    max-width: 190px;
    color: #536078;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    word-break: break-all;
}

.user-role {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border-radius: 999px;
    font-size: 7px;
    font-weight: 850;
    white-space: nowrap;
}

.user-role.admin {
    background: rgba(34,197,94,.08);
    color: #86efac;
}

.user-role.user {
    background: rgba(148,163,184,.08);
    color: #aab6c7;
}

.user-table-empty {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 25px;
    color: #536078;
    font-size: 9px;
    text-align: center;
}

.user-table-empty i {
    font-size: 16px;
}

@media (max-width: 650px) {
    .management-head,
    .user-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .refresh-users-btn {
        width: 100%;
    }

    .user-list-status {
        text-align: left;
    }
}
