/* =========================================================
   RAJ MOCK TEST V2.0
   ADMIN DASHBOARD
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {

    --primary: #2563eb;
    --primary-dark: #1d4ed8;

    --text: #172033;
    --muted: #64748b;

    --bg: #f5f7fb;
    --white: #ffffff;

    --border: #e5e7eb;

    --sidebar: #111827;

    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.06);

    --radius: 16px;
}

html {
    scroll-behavior: smooth;
}

body {

    font-family:
        "Poppins",
        sans-serif;

    background: var(--bg);

    color: var(--text);

    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
}



/* =========================================================
   APP
========================================================= */

.admin-app {

    display: flex;

    min-height: 100vh;
}



/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {

    width: 260px;

    background:
        linear-gradient(
            180deg,
            #111827 0%,
            #0f172a 100%
        );

    color: white;

    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    z-index: 1000;

    display: flex;

    flex-direction: column;

    padding: 22px 15px;
}



/* BRAND */

.sidebar-brand {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 5px 10px 25px;

    border-bottom:
        1px solid
        rgba(255,255,255,0.08);
}

.brand-logo {

    width: 46px;
    height: 46px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #7c3aed
        );

    font-size: 23px;

    box-shadow:
        0 8px 20px
        rgba(37,99,235,0.35);
}

.brand-text {

    display: flex;

    flex-direction: column;
}

.brand-text strong {

    font-size: 17px;

    font-weight: 700;
}

.brand-text span {

    font-size: 10px;

    letter-spacing: 1.8px;

    color: #94a3b8;

    margin-top: 2px;
}



/* NAVIGATION */

.sidebar-nav {

    flex: 1;

    overflow-y: auto;

    padding-top: 20px;
}

.nav-title {

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1.5px;

    color: #64748b;

    padding:
        14px 13px 8px;
}

.nav-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 11px 13px;

    margin: 3px 0;

    border-radius: 10px;

    color: #cbd5e1;

    font-size: 13px;

    font-weight: 500;

    transition:
        0.2s ease;
}

.nav-item:hover {

    color: white;

    background:
        rgba(255,255,255,0.07);

    transform: translateX(2px);
}

.nav-item.active {

    color: white;

    background:
        linear-gradient(
            90deg,
            rgba(37,99,235,0.95),
            rgba(37,99,235,0.65)
        );

    box-shadow:
        0 7px 18px
        rgba(37,99,235,0.25);
}

.nav-icon {

    width: 28px;

    text-align: center;

    font-size: 17px;
}



/* SIDEBAR BOTTOM */

.sidebar-bottom {

    border-top:
        1px solid
        rgba(255,255,255,0.08);

    padding-top: 15px;
}

.admin-mini-profile {

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 8px;
}

.mini-avatar {

    width: 38px;
    height: 38px;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #7c3aed
        );

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: 700;
}

.admin-mini-profile div:last-child {

    display: flex;

    flex-direction: column;
}

.admin-mini-profile strong {

    font-size: 12px;
}

.admin-mini-profile span {

    font-size: 10px;

    color: #94a3b8;
}

.sidebar-logout {

    width: 100%;

    margin-top: 10px;

    border: 1px solid
        rgba(255,255,255,0.08);

    background:
        rgba(255,255,255,0.04);

    color: #cbd5e1;

    padding: 10px;

    border-radius: 9px;

    cursor: pointer;

    transition: 0.2s;
}

.sidebar-logout:hover {

    background: #dc2626;

    color: white;
}



/* =========================================================
   MAIN AREA
========================================================= */

.main-area {

    margin-left: 260px;

    width:
        calc(100% - 260px);

    min-height: 100vh;
}



/* =========================================================
   TOPBAR
========================================================= */

.topbar {

    height: 78px;

    background:
        rgba(255,255,255,0.96);

    border-bottom:
        1px solid var(--border);

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        0 30px;

    position: sticky;

    top: 0;

    z-index: 100;

    backdrop-filter: blur(10px);
}

.top-left {

    display: flex;

    align-items: center;

    gap: 15px;
}

.top-label {

    display: block;

    font-size: 9px;

    letter-spacing: 1.5px;

    color: var(--primary);

    font-weight: 700;
}

.top-left h1 {

    font-size: 22px;

    margin-top: 1px;
}

.menu-btn {

    display: none;

    border: none;

    background: #f1f5f9;

    width: 40px;
    height: 40px;

    border-radius: 9px;

    cursor: pointer;

    font-size: 20px;
}

.top-right {

    display: flex;

    align-items: center;

    gap: 20px;
}

.refresh-btn {

    border: 1px solid var(--border);

    background: white;

    padding: 9px 14px;

    border-radius: 9px;

    color: #475569;

    cursor: pointer;

    font-size: 12px;

    transition: 0.2s;
}

.refresh-btn:hover {

    border-color: var(--primary);

    color: var(--primary);

    background: #eff6ff;
}

.top-admin {

    display: flex;

    align-items: center;

    gap: 9px;

    padding-left: 18px;

    border-left:
        1px solid var(--border);
}

.top-avatar {

    width: 37px;
    height: 37px;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #7c3aed
        );

    color: white;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 13px;

    font-weight: 700;
}

.top-admin-info {

    display: flex;

    flex-direction: column;
}

.top-admin-info strong {

    font-size: 12px;
}

.top-admin-info span {

    font-size: 10px;

    color: var(--muted);
}



/* =========================================================
   CONTENT
========================================================= */

.dashboard-content {

    max-width: 1500px;

    margin: auto;

    padding: 30px;
}



/* =========================================================
   WELCOME
========================================================= */

.welcome-card {

    background:
        linear-gradient(
            120deg,
            #1d4ed8,
            #4f46e5,
            #7c3aed
        );

    color: white;

    border-radius: 20px;

    padding:
        28px 32px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    overflow: hidden;

    position: relative;

    margin-bottom: 25px;

    box-shadow:
        0 15px 35px
        rgba(37,99,235,0.18);
}

.welcome-card::after {

    content: "";

    position: absolute;

    width: 250px;
    height: 250px;

    border-radius: 50%;

    background:
        rgba(255,255,255,0.08);

    right: 100px;
    top: -120px;
}

.welcome-small {

    font-size: 12px;

    opacity: 0.85;
}

.welcome-content h2 {

    font-size: 27px;

    margin-top: 5px;

    font-weight: 700;
}

.welcome-content h2 span {

    opacity: 0.7;
}

.welcome-content p {

    font-size: 12px;

    opacity: 0.85;

    max-width: 650px;

    margin-top: 5px;
}

.welcome-icon {

    font-size: 65px;

    position: relative;

    z-index: 2;

    transform:
        rotate(-5deg);
}



/* =========================================================
   STATS
========================================================= */

.stats-grid {

    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 15px;

    margin-bottom: 25px;
}

.stat-card {

    background: white;

    border: 1px solid var(--border);

    border-radius: 15px;

    padding: 18px;

    box-shadow: var(--shadow);

    transition:
        0.2s ease;
}

.stat-card:hover {

    transform:
        translateY(-3px);

    box-shadow:
        0 15px 35px
        rgba(15,23,42,0.09);
}

.stat-top {

    display: flex;

    align-items: center;

    justify-content: space-between;
}

.stat-icon {

    width: 40px;
    height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    font-size: 18px;
}

.stat-tag {

    font-size: 8px;

    font-weight: 700;

    letter-spacing: 1px;

    color: var(--muted);
}

.stat-bottom {

    margin-top: 16px;

    display: flex;

    flex-direction: column;
}

.stat-bottom strong {

    font-size: 27px;

    line-height: 1.1;
}

.stat-bottom span {

    font-size: 10px;

    color: var(--muted);

    margin-top: 3px;
}


/* Stat Colors */

.blue .stat-icon {

    background: #eff6ff;
}

.purple .stat-icon {

    background: #f5f3ff;
}

.orange .stat-icon {

    background: #fff7ed;
}

.green .stat-icon {

    background: #f0fdf4;
}

.red .stat-icon {

    background: #fef2f2;
}



/* =========================================================
   SECTION CARD
========================================================= */

.section-card {

    background: white;

    border:
        1px solid var(--border);

    border-radius: 17px;

    padding: 24px;

    box-shadow: var(--shadow);

    margin-bottom: 25px;
}

.section-heading {

    margin-bottom: 20px;
}

.section-label {

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 1.5px;

    color: var(--primary);
}

.section-heading h2 {

    font-size: 19px;

    margin-top: 3px;
}

.section-heading p {

    font-size: 11px;

    color: var(--muted);

    margin-top: 2px;
}



/* =========================================================
   ACTION GRID
========================================================= */

.action-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 13px;
}

.action-card {

    min-height: 105px;

    border:
        1px solid var(--border);

    border-radius: 13px;

    padding: 15px;

    display: flex;

    align-items: center;

    gap: 12px;

    position: relative;

    transition:
        0.2s ease;

    background: #fff;
}

.action-card:hover {

    transform:
        translateY(-3px);

    border-color:
        #cbd5e1;

    box-shadow:
        0 10px 25px
        rgba(15,23,42,0.07);
}

.action-icon {

    min-width: 43px;

    width: 43px;
    height: 43px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 11px;

    font-size: 19px;
}

.blue-icon {
    background: #eff6ff;
}

.purple-icon {
    background: #f5f3ff;
}

.orange-icon {
    background: #fff7ed;
}

.red-icon {
    background: #fef2f2;
}

.green-icon {
    background: #f0fdf4;
}

.cyan-icon {
    background: #ecfeff;
}

.yellow-icon {
    background: #fefce8;
}

.pink-icon {
    background: #fdf2f8;
}

.action-content {

    min-width: 0;

    padding-right: 15px;
}

.action-content h3 {

    font-size: 13px;

    font-weight: 700;
}

.action-content p {

    color: var(--muted);

    font-size: 9px;

    line-height: 1.5;

    margin-top: 3px;
}

.action-arrow {

    position: absolute;

    right: 12px;

    bottom: 10px;

    color: #94a3b8;

    font-size: 17px;

    transition: 0.2s;
}

.action-card:hover
.action-arrow {

    color: var(--primary);

    transform:
        translateX(3px);
}



/* =========================================================
   SYSTEM STATUS
========================================================= */

.status-section {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 15px;

    margin-bottom: 25px;
}

.system-card {

    background: white;

    border:
        1px solid var(--border);

    border-radius: 15px;

    padding: 18px 20px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    box-shadow: var(--shadow);
}

.system-left {

    display: flex;

    align-items: center;

    gap: 13px;
}

.system-icon {

    width: 43px;
    height: 43px;

    border-radius: 11px;

    background: #f1f5f9;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 20px;
}

.system-label {

    display: block;

    color: var(--muted);

    font-size: 8px;

    font-weight: 700;

    letter-spacing: 1.2px;
}

.system-left strong {

    display: block;

    font-size: 13px;

    margin-top: 2px;
}

.system-left p {

    color: var(--muted);

    font-size: 9px;

    margin-top: 2px;
}

.firebase-status {

    font-size: 10px;

    font-weight: 600;

    color: #16a34a;

    white-space: nowrap;
}

.status-dot {

    font-size: 12px;
}

.open-portal-btn {

    background: #eff6ff;

    color: var(--primary);

    border-radius: 8px;

    padding: 9px 13px;

    font-size: 10px;

    font-weight: 600;

    transition: 0.2s;
}

.open-portal-btn:hover {

    background: var(--primary);

    color: white;
}



/* =========================================================
   FOOTER
========================================================= */

.dashboard-footer {

    display: flex;

    justify-content: space-between;

    color: #94a3b8;

    font-size: 9px;

    padding:
        5px 3px 20px;
}



/* =========================================================
   SIDEBAR OVERLAY
========================================================= */

.sidebar-overlay {

    display: none;

    position: fixed;

    inset: 0;

    background:
        rgba(15,23,42,0.45);

    z-index: 900;
}



/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1250px) {

    .stats-grid {

        grid-template-columns:
            repeat(3, 1fr);
    }

    .action-grid {

        grid-template-columns:
            repeat(3, 1fr);
    }
}


@media (max-width: 900px) {

    .sidebar {

        transform:
            translateX(-100%);

        transition:
            0.25s ease;
    }

    .sidebar.open {

        transform:
            translateX(0);
    }

    .sidebar.open + .main-area {

        /* no-op */
    }

    .sidebar-overlay.active {

        display: block;
    }

    .main-area {

        margin-left: 0;

        width: 100%;
    }

    .menu-btn {

        display: flex;

        align-items: center;
        justify-content: center;
    }

    .stats-grid {

        grid-template-columns:
            repeat(2, 1fr);
    }

    .action-grid {

        grid-template-columns:
            repeat(2, 1fr);
    }

    .status-section {

        grid-template-columns: 1fr;
    }
}


@media (max-width: 600px) {

    .topbar {

        padding:
            0 15px;
    }

    .top-admin-info {

        display: none;
    }

    .top-admin {

        padding-left: 10px;

        border-left: none;
    }

    .refresh-btn span {

        display: none;
    }

    .refresh-btn {

        width: 38px;
        height: 38px;

        padding: 0;

        display: flex;

        align-items: center;
        justify-content: center;
    }

    .dashboard-content {

        padding: 15px;
    }

    .welcome-card {

        padding: 22px;

        min-height: 170px;
    }

    .welcome-content h2 {

        font-size: 21px;
    }

    .welcome-content p {

        font-size: 10px;

        max-width: 85%;
    }

    .welcome-icon {

        font-size: 45px;

        position: absolute;

        right: 18px;

        bottom: 18px;
    }

    .stats-grid {

        grid-template-columns: 1fr 1fr;

        gap: 10px;
    }

    .stat-card {

        padding: 13px;
    }

    .stat-bottom strong {

        font-size: 22px;
    }

    .section-card {

        padding: 15px;
    }

    .action-grid {

        grid-template-columns: 1fr;
    }

    .action-card {

        min-height: 85px;
    }

    .system-card {

        align-items: flex-start;

        gap: 12px;

        flex-direction: column;
    }

    .dashboard-footer {

        flex-direction: column;

        gap: 5px;
    }
}


@media (max-width: 380px) {

    .stats-grid {

        grid-template-columns: 1fr;
    }

    .top-left h1 {

        font-size: 19px;
    }
}