.topbar {
    position: sticky;
    top: 12px;
    z-index: 1000;
    width: min(100% - 24px, 1500px);
    max-width: 1500px;
    margin: 12px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 22px;
    background: linear-gradient(135deg, rgba(11, 122, 114, .96), rgba(15, 118, 110, .95) 52%, rgba(17, 94, 89, .95));
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 9999px;
    box-shadow: 0 16px 36px rgba(15, 118, 110, .22);
    transition: box-shadow .3s ease, transform .3s ease;
}

.topbar:hover {
    box-shadow: 0 18px 40px rgba(15, 118, 110, .26);
    transform: translateY(-1px);
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
}

.topbar .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 22px rgba(15, 118, 110, .22);
}

.topbar-nav,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.topbar-nav a,
.topbar-actions > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 16px;
    border-radius: 9999px;
    color: rgba(255, 255, 255, .84);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.topbar-nav a:hover,
.topbar-nav a.is-active,
.topbar-actions > a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .14);
    transform: translateY(-1px);
}

.topbar-nav a.topbar-school-link,
.topbar-actions > a.topbar-admin-link {
    color: #fff;
    background: linear-gradient(135deg, #0284c7, #0f766e);
    box-shadow: 0 8px 22px rgba(15, 118, 110, .18);
}

.topbar-nav a.topbar-school-link:hover,
.topbar-nav a.topbar-school-link.is-active,
.topbar-actions > a.topbar-admin-link:hover {
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #14b8a6);
    box-shadow: 0 12px 28px rgba(15, 118, 110, .24);
}

.topbar-actions > a.topbar-app-link {
    width: 40px;
    padding: 0;
    background: rgba(255, 255, 255, .14);
    box-shadow: none;
}

.topbar .language-switch {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, .12);
}

.topbar .language-switch .lang-pill {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
    border: 0;
    border-radius: 9999px;
    color: rgba(255, 255, 255, .78);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.topbar .language-switch .lang-pill.active {
    color: #115e59;
    background: #fff;
    box-shadow: 0 4px 14px rgba(2, 6, 23, .12);
}

@media (max-width: 1100px) {
    .topbar {
        top: 8px;
        width: calc(100% - 24px);
        margin-top: 8px;
        padding: 8px 12px;
    }

    .topbar-nav {
        display: none;
    }

    .topbar .brand {
        font-size: .9rem;
    }

    .topbar-actions {
        justify-content: center;
    }
}
