:root {
    --app-bg: #f4f6fb;
    --app-card-bg: #ffffff;
    --app-border: #e5e7eb;
    --app-text: #1f2937;
    --app-muted: #6b7280;
    --app-primary: #0d6efd;
    --app-danger: #dc3545;
    --app-navbar-bg: rgba(17, 24, 39, 0.94);
    --app-navbar-border: rgba(255, 255, 255, 0.08);
    --app-radius: 18px;
}

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
    padding-top: 72px;
    min-height: 100vh;
}

.app-navbar {
    min-height: 60px;
    background:
        linear-gradient(180deg, rgba(31, 41, 55, 0.96), var(--app-navbar-bg)) !important;
    border-bottom: 1px solid var(--app-navbar-border);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.app-navbar-container {
    min-height: 56px;
}

.app-brand {
    font-weight: 850;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.96) !important;
}

.app-revision-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    margin-right: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.22);
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.72rem;
    font-weight: 850;
    white-space: nowrap;
}

.app-revision-date {
    color: rgba(255, 255, 255, 0.74);
}

.app-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    font-weight: 700;
}

.app-user-name.btn,
.app-admin-btn,
.app-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 999px;
    font-weight: 800;
    padding: 0.35rem 0.85rem;
}

.app-user-name.btn {
    border-color: rgba(255, 255, 255, 0.26);
    background: blue;
    color: rgba(255, 255, 255, 0.92) !important;
}

.app-admin-btn {
    border: 0;
    background: rgba(255, 193, 7, 0.92);
    color: #111827;
}

.app-logout-btn {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.app-main {
    min-height: calc(100vh - 72px);
}

.app-container {
    padding-bottom: 32px;
}

.app-alert {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    height: 68px;
    padding-bottom: env(safe-area-inset-bottom);
    background:
        linear-gradient(180deg, rgba(31, 41, 55, 0.96), rgba(17, 24, 39, 0.98));
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.26);
    border-radius: 0;
}

.mobile-nav-item {
    flex: 1;
    height: 100%;
    color: rgba(229, 231, 235, 0.64);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    font-weight: 750;
}

.mobile-nav-item.active {
    color: #ffffff;
    font-weight: 850;
}

.mobile-nav-icon {
    font-size: 1.15rem;
}

.mobile-nav-text {
    font-size: 0.7rem;
}

.global-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(14px) saturate(170%);
}

.global-loading-overlay.d-none {
    display: none !important;
}

.loading-box {
    min-width: 230px;
    padding: 26px 24px;
    text-align: center;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 24px;
    box-shadow: 0 22px 55px rgba(15,23,42,0.18);
}

.loading-title {
    margin-top: 14px;
    font-size: 0.96rem;
    font-weight: 850;
}

.loading-message {
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6b7280;
}

@media (max-width: 767.98px) {
    body {
        padding-top: 58px;
        padding-bottom: calc(62px + env(safe-area-inset-bottom));
    }

    .app-navbar {
        min-height: 52px;
    }

    .app-navbar-container {
        min-height: 48px;
    }

    .app-brand {
        font-size: 0.94rem;
    }

    .app-revision-pill {
        min-height: 26px;
        padding: 3px 8px;
        font-size: 0.62rem;
    }

    .app-revision-date {
        display: none;
    }

    .app-user-name {
        max-width: 82px;
        font-size: 0.7rem;
    }

    .app-container {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 18px;
    }

    .app-message-area {
        margin-top: 8px;
    }

    .app-alert {
        padding: 8px 10px;
        font-size: 0.72rem;
        border-radius: 10px;
    }

    .loading-box {
        min-width: 210px;
        max-width: calc(100vw - 48px);
        padding: 20px 16px;
        border-radius: 16px;
    }

    .loading-title {
        font-size: 0.86rem;
    }

    .loading-message {
        font-size: 0.72rem;
    }

    .mobile-bottom-nav {
        height: 62px;
        border-radius: 0;
    }

    .mobile-nav-item {
        gap: 1px;
    }

    .mobile-nav-icon {
        font-size: 1rem;
        line-height: 1;
    }

    .mobile-nav-text {
        font-size: 0.62rem;
    }

    .admin-only-action {
        display: none !important;
    }
}
