:root {
    --app-bottom-nav-height: 4rem;
}

html, body {
    height: 100%;
    margin: 0;
    background: #f4f5f7;
}

#blazor-error-ui {
    display: none;
    background: #fffae6;
    border-top: 3px solid #ffc107;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0,0,0,.2);
    padding: .75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 100vh;
}

/* ---------------------------------------------------------------------
   App shell: top bar + scrollable content + fixed bottom tab bar.
   Padded for iOS/Android safe areas so content never sits under a notch
   or a gesture bar.
--------------------------------------------------------------------- */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: env(safe-area-inset-top, 0);
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-brand {
    font-weight: 600;
    font-size: 1.1rem;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.app-content {
    flex: 1 1 auto;
    padding: 1rem;
    padding-bottom: calc(var(--app-bottom-nav-height) + env(safe-area-inset-bottom, 0) + 1rem);
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.app-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 20;
}

.app-bottom-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    padding: .5rem 0;
    height: var(--app-bottom-nav-height);
    color: #6b7280;
    text-decoration: none;
    font-size: .75rem;
}

.app-bottom-nav-item .bi {
    font-size: 1.25rem;
}

.app-bottom-nav-item.active {
    color: #0d6efd;
}

/* ---------------------------------------------------------------------
   Time Log page
--------------------------------------------------------------------- */
.timelog-form-card,
.timelog-entry-card {
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    padding: 1rem;
    margin-bottom: .75rem;
    background: #fff;
}

.timelog-form-card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Larger touch targets on mobile form controls */
.timelog-form-card .form-control,
.timelog-form-card .form-select {
    min-height: 2.75rem;
}

.timelog-list h3 {
    font-size: 1rem;
    color: #6b7280;
    margin: 1rem 0 .5rem;
}

.timelog-entry-main {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.timelog-entry-desc {
    color: #6b7280;
    font-size: .9rem;
    margin: .25rem 0 .5rem;
}

.timelog-entry-actions {
    display: flex;
    gap: .5rem;
}

/* Ripple loading indicator, matching BlazorAdmin's Loading component */
.waiting {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.6);
    z-index: 30;
}

.lds-ripple {
    display: inline-block;
    position: relative;
    width: 48px;
    height: 48px;
}

.lds-ripple div {
    position: absolute;
    border: 3px solid #0d6efd;
    opacity: 1;
    border-radius: 50%;
    animation: lds-ripple 1.2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.lds-ripple div:nth-child(2) {
    animation-delay: -0.6s;
}

@keyframes lds-ripple {
    0% {
        top: 24px;
        left: 24px;
        width: 0;
        height: 0;
        opacity: 0;
    }
    4.9% {
        top: 24px;
        left: 24px;
        width: 0;
        height: 0;
        opacity: 0;
    }
    5% {
        top: 24px;
        left: 24px;
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        top: 0;
        left: 0;
        width: 48px;
        height: 48px;
        opacity: 0;
    }
}
