:root {
    color-scheme: light;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-image: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 45%);
    margin: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #1d4ed8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.app-logo {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.app-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.app-nav a {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.app-nav a.active,
.app-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.header-actions a {
    color: #fff;
    text-decoration: none;
}

.page-content {
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .app-nav {
        width: 100%;
        margin-top: 0.35rem;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .app-nav .nav-label {
        display: none;
        color: #6B7386;
    }

    .app-nav a {
        padding: 0.4rem;
        font-size: 1rem;
    }

    .app-nav i {
        font-size: 1.1rem;
    }

    .page-content {
        padding: 1rem;
    }
}

.btn-primary {
    background-color: #2563eb;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.card {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 45px -25px rgba(15, 23, 42, 0.4);
    padding: 1.75rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    min-width: 250px;
    max-width: 320px;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    color: #0f172a;
    background: #fff;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.2);
    border-left: 4px solid #2563eb;
    animation: toast-in 0.25s ease, toast-out 0.3s ease 4.5s forwards;
}

.toast.success {
    border-left-color: #16a34a;
}

.toast.error {
    border-left-color: #dc2626;
}

.toast.warning {
    border-left-color: #f97316;
}

@keyframes toast-in {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    to {
        transform: translateX(30px);
        opacity: 0;
    }
}

.back-button {
    position: fixed;
    left: 1.25rem;
    bottom: 1.25rem;
    z-index: 1100;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    font-weight: 600;
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.35);
}

@media (max-width: 640px) {
    .back-button {
        left: 0.75rem;
        bottom: 0.75rem;
        padding: 0.5rem 0.9rem;
    }
}

.admin-menu {
    position: relative;
    min-width: 190px;
}

.admin-menu__button {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    color: #0f172a;
    padding: 0.35rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    font: inherit;
}

.admin-menu__button:disabled {
    opacity: 1;
    cursor: default;
}

.admin-menu__button:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.6);
    outline-offset: 2px;
}

.admin-menu__avatar {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.admin-menu__avatar-initial {
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #0f172a;
}

.admin-menu__label {
    color: #0f172a;
    font-weight: 600;
    font-size: 0.95rem;
}

.app-header .admin-menu__button,
.app-header .admin-menu__button:disabled {
    color: #0f172a;
}

.app-header .admin-menu__label {
    color: #0f172a;
}

.admin-menu__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.admin-menu__name {
    font-weight: 600;
}

.admin-menu__role {
    font-size: 0.75rem;
    opacity: 0.85;
}

.admin-menu__chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.admin-menu__dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 220px;
    background: #fff;
    color: #0f172a;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(15, 23, 42, 0.05);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 2000;
}

.admin-menu__dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.65rem;
    padding: 0.45rem 0.6rem;
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

.admin-menu__dropdown a:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.admin-menu__section {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0.2rem 0.6rem;
}

.admin-menu--enabled .admin-menu__button:not(:disabled):hover {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.35);
}

.admin-menu--open .admin-menu__dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.admin-menu--open .admin-menu__chevron {
    transform: rotate(180deg);
}

.admin-menu--open .admin-menu__button {
    background: rgba(255, 255, 255, 0.25);
}
