:root {
    --admin-bg: #f6f4fb;
    --admin-card: #ffffff;
    --admin-text: #1f1934;
    --admin-muted: #6d6683;
    --admin-primary: #6d4de6;
    --admin-border: #e3def2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
}

a {
    text-decoration: none;
    color: inherit;
}
/* ===== Layout ===== */
.admin-main {
    flex: 1;
    padding: 30px 36px 50px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card {
    background: var(--admin-card);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--admin-border);
    box-shadow: 0 12px 30px rgba(29, 20, 60, 0.08);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--admin-border);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.stat-label {
    color: var(--admin-muted);
    font-size: 13px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--admin-border);
}

.table th {
    font-size: 13px;
    color: var(--admin-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: var(--admin-primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    background: #f2effa;
    color: var(--admin-text);
}

.btn-link {
    background: none;
    border: none;
    color: var(--admin-primary);
    cursor: pointer;
    padding: 0;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    font-family: inherit;
}

textarea {
    min-height: 120px;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(82, 245, 93, 0.318);
    color: #0f7f69;
    margin-bottom: 16px;
}

.error {
    color: #b42318;
    font-size: 13px;
    margin-top: 6px;
}

.login-wrap {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1b132d, #2c1e44);
}


.login-card {
    width: min(420px, 90vw);
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(150, 135, 202, 0.842);

}

.login-card h2 {
    margin-top: 0;
}

 /* ===== Sidebar Container ===== */
    .admin-layout {
        display: flex;
        min-height: 100vh;
    }

    /* Sidebar */
    .admin-sidebar {
        width: 250px;
        background: #1e1433;
        transition: width 0.3s ease;
        overflow: hidden;
        flex-shrink: 0;
        /* IMPORTANT */
    }

    .admin-content {
        flex: 1;
        width: 100%;
    }

    /* Collapsed desktop */
    .admin-sidebar.collapsed {
        width: 90px;
    }

    /* ===== Sidebar ===== */
    .sidebar {
        width: 100%;
        height: 100%;
        background: #1e1433;
        /* adjust if needed */
        color: #fff;
        display: flex;
        flex-direction: column;
    }

    /* ===== Header ===== */
    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px;
    }

    /* Logo Image */
    .logo {
        width: 40px;
        height: 40px;
        transition: all 0.3s ease;
    }

    /* Logo Text */
    .logo-text {
        font-size: 18px;
        margin: 0;
        white-space: nowrap;
    }

    /* Hide logo text when collapsed */
    .admin-sidebar.collapsed .logo-text {
        display: none;
    }

    /* OPTIONAL: hide logo image when collapsed */
    .admin-sidebar.collapsed .logo {
        display: none;
    }

    /* Center header content when collapsed */
    .admin-sidebar.collapsed .sidebar-header {
        justify-content: center;
    }

    /* ===== Links ===== */
    .sidebar-links {
        display: flex;
        flex-direction: column;
    }

    /* Links & Buttons */
    .sidebar a,
    .sidebar button {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        color: #fff;
        text-decoration: none;
        border: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
        font-size: 15px;
        background: none;
        transition: background 0.2s ease;
    }

    /* Hover */
    .sidebar a:hover,
    .sidebar button:hover {
        background: #334155;
    }

    /* Icons */
    .sidebar i {
        min-width: 20px;
        text-align: center;
        font-size: 16px;
    }

    /* Text beside icons */
    .sidebar .text {
        white-space: nowrap;
    }

    /* Hide text when collapsed */
    .admin-sidebar.collapsed .text {
        display: none;
    }

    /* Center icons when collapsed */
    .admin-sidebar.collapsed .sidebar a,
    .admin-sidebar.collapsed .sidebar button {
        justify-content: center;
        padding: 12px 0;
    }

    /* ===== Logout at bottom ===== */
    .logout {
        margin-top: auto;
        padding: 5px;
        background: #cf0101;
        border: none;
        border-radius: 4px;
    }

    /* ===== Toggle Button ===== */
    .toggle-btn {
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
        font-size: 18px;
    }

    /* Sidebar already has width */

    /* ======MOBILE FIX========================== */
    @media (max-width: 768px) {

        .admin-layout {
            display: block;
            /* stop flex */
        }

        .admin-sidebar {
            position: fixed;
            top: 0;
            left: 0;
            height: 100vh;
            transform: translateX(-100%);
            transition: transform 0.3s ease;
            z-index: 1000;
        }

        .admin-sidebar.show {
            transform: translateX(0);
        }

        .admin-content {
            width: 100%;
        }
    }

