:root {
    --white: #FFFFFF;
    --yellow: #FFD93D;
    --blue: #1E90FF;
    --purple: #6A4CFF;
    --mb-purple: #6d45f5;
    --mb-purple-soft: #eee8ff;
    --mb-bg: #fbfbfc;
    --mb-line: #e5e7eb;
    --mb-text: #1f232b;
    --mb-muted: #5d6675;

    --text-dark: #222;
    --bg-light: #F5F5F5;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--mb-bg);
    color: var(--mb-text);
}

.sidebar {
    width: 248px;
    background: var(--white);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    border-right: 1px solid var(--mb-line);
}

.sidebar-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px 12px 20px;
}

.mobile-topbar {
    display: none;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 16px;
    border-bottom: 1px solid var(--mb-line);
    margin-bottom: 14px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--mb-purple);
    display: grid;
    place-items: center;
    color: var(--white);
    font-size: 21px;
    box-shadow: 0 5px 14px rgba(109,69,245,.18);
}

.brand-name {
    font-weight: 800;
    font-size: 15px;
}

.studio-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 8px 16px;
    font-size: 12px;
    color: #111827;
}

.plan-tag {
    background: #f4f4f5;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 11px;
    color: #111827;
}

.side-nav {
    display: grid;
    gap: 7px;
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 7px;
    color: #151922;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.sidebar .nav-item span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sidebar .nav-item:hover {
    background: #f5f5f6;
    color: #151922;
}

.sidebar .nav-item.active {
    background: var(--mb-purple-soft);
    color: var(--mb-purple);
    font-weight: 700;
}

.sidebar .nav-item i,
.sidebar .nav-item .icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex: 0 0 18px;
}

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--mb-line);
    padding: 18px 8px 0;
}

.signed-in {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-bottom: 12px;
}

.avatar {
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: #efe7ff;
    color: #5d32d6;
    display: grid;
    place-items: center;
    font-size: 13px;
    flex: 0 0 auto;
}

.signed-in small {
    display: block;
    color: var(--mb-muted);
    line-height: 1.25;
}

.signed-in strong {
    display: block;
    color: #111827;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.sign-out {
    width: 100%;
    justify-content: flex-start;
    background: #f7f7f8;
}

.sidebar-scrim {
    display: none;
}

.sidebar-toggle {
    width: 38px;
    height: 34px;
    border-radius: 5px;
    border: 1px solid var(--mb-line);
    background: var(--white);
    color: #151922;
    display: grid;
    place-items: center;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.main-content {
    margin-left: 248px;
    padding: 44px 54px;
    background: var(--mb-bg);
    min-height: 100vh;
}

@media (max-width: 760px) {
    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 90;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px;
        background: var(--white);
        border-bottom: 1px solid var(--mb-line);
    }

    .sidebar {
        width: min(82vw, 286px);
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-scrim {
        position: fixed;
        inset: 0;
        z-index: 95;
        display: block;
        background: rgba(15, 23, 42, .28);
        border: 0;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    body.sidebar-open .sidebar-scrim {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 28px 18px;
    }
}

/* CARDS */
.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* BUTTONS */
.button {
    background: var(--blue);
    color: var(--white);
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    margin-right: 10px;
}

.button:hover {
    background: var(--yellow);
    color: var(--text-dark);
}

.button.small {
    padding: 6px 10px;
    font-size: 13px;
}

.button.danger {
    background: #d9534f;
    color: white;
}

/* AUTH PAGES */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--purple);
}

.auth-container {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    width: 350px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.auth-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.error {
    background: #ffe0e0;
    color: #a30000;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* TABLE */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th {
    background: var(--purple);
    color: var(--white);
    padding: 10px;
    text-align: left;
}

.table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* Form Title */
.form-title {
    margin-bottom: 20px;
    color: var(--purple);
    font-size: 22px;
}

/* Form Layout */
.student-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Two-column rows */
.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    width: 100%;
}

/* Inputs */
.student-form input,
.student-form textarea {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 15px;
    background: #fafafa;
    transition: border 0.2s ease, background 0.2s ease;
}

.student-form input:focus,
.student-form textarea:focus {
    border-color: var(--blue);
    background: var(--white);
    outline: none;
}

/* Add Button */
.add-btn {
    background: var(--purple);
    color: var(--white);
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 6px;
    margin-top: 10px;
    transition: background 0.2s ease;
}

.add-btn:hover {
    background: var(--yellow);
    color: var(--text-dark);
}

.pagination {
    margin-top: 20px;
}

.pagination .button.small {
    margin-right: 10px;
}

.form-label {
    font-weight: bold;
    margin-bottom: 5px;
}
