html,
body {
    min-height: 100%;
    margin: 0;
    background: #f6f7f9;
}

.foundation-main {
    min-height: 100vh;
    padding-top: 64px;
    display: flex;
    align-items: center;
}

.app-main {
    min-height: 100vh;
    padding-top: 64px;
    background: #f6f7f9;
}

.app-shell,
.app-content {
    width: 100%;
    min-width: 0;
}

.app-topbar {
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.app-topbar-logo {
    display: block;
    width: 4.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    object-fit: contain;
}

.app-topbar-title {
    font-weight: 650;
    letter-spacing: -.01em;
}

.pwa-install-action {
    flex: 0 0 auto;
}

.app-nav-region {
    position: sticky;
    top: 64px;
    z-index: 100;
    border-bottom: 1px solid #eaecf0;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
    backdrop-filter: blur(10px);
}

.app-nav-container {
    min-width: 0;
}

.app-nav {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: .55rem 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.app-nav::-webkit-scrollbar {
    display: none;
}

.app-nav .mud-button-root {
    min-height: 2.65rem;
    flex: 0 0 auto;
    border-radius: 9px;
    color: #344054;
    font-size: .8125rem;
    letter-spacing: .01em;
}

.app-nav .mud-button-root:hover {
    background: rgba(111, 100, 45, .08);
    color: #554c22;
}

.app-nav .app-nav-link-active {
    background: rgba(111, 100, 45, .12);
    color: #554c22;
    font-weight: 700;
}

.app-content {
    box-sizing: border-box;
    padding-bottom: max(2rem, env(safe-area-inset-bottom)) !important;
}

.page-shell {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
}

.auth-shell { max-width: 30rem; }
.form-shell { max-width: 50rem; }
.detail-shell { max-width: 46rem; }
.home-shell { max-width: 60rem; }
.content-shell { max-width: 72rem; }

.app-card {
    border: 1px solid #eaecf0;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .07) !important;
}

.app-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
}

.app-brand-logo {
    display: block;
    width: 5.25rem;
    height: 3rem;
    flex: 0 0 auto;
    object-fit: contain;
}

.app-brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.2;
}

.app-brand-company {
    color: #7a6b34;
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1.2;
}

.app-brand-name {
    color: #101828;
    font-weight: 750;
    line-height: 1.25;
}

.app-card-brand {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eaecf0;
}

.home-content {
    max-width: 100%;
}

.home-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-heading-icon {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #f4f3ea;
}

.page-header {
    display: grid;
    gap: .5rem;
    padding: .25rem .25rem .5rem;
}

.page-title {
    color: #101828;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.2;
}

.page-subtitle {
    max-width: 48rem;
    color: #475467;
}

.section-title {
    color: #101828;
    font-weight: 700;
    letter-spacing: -.015em;
}

.page-actions,
.form-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.page-primary-action {
    min-height: 2.9rem;
}

.home-card .page-primary-action,
.auth-card .page-primary-action,
.form-card .page-primary-action,
.detail-card .page-primary-action {
    width: 100%;
}

.app-card .mud-alert {
    border-radius: 12px;
}

.app-card .mud-table-container {
    border: 1px solid #eaecf0;
    border-radius: 12px;
    overflow: hidden;
}

.app-card .mud-table-head {
    background: #fcfcfd;
}

.app-card .mud-table-cell {
    border-color: #eaecf0;
}

.notification-connection {
    border-width: 1px;
    font-weight: 700;
}

.notification-connection-online {
    border-color: #abefc6 !important;
    background: #ecfdf3 !important;
    color: #067647 !important;
}

.notification-connection-offline {
    border-color: #fedf89 !important;
    background: #fffaeb !important;
    color: #b54708 !important;
}

.notification-empty-state {
    display: flex;
    min-height: 4.75rem;
    box-sizing: border-box;
    align-items: center;
    gap: .875rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e1cf;
    border-radius: 12px;
    background: #faf9f4;
    color: #554c22;
}

.notification-empty-icon {
    flex: 0 0 auto;
    color: #7a6b34;
}

.notification-list {
    overflow: hidden;
    border: 1px solid #eaecf0;
    border-radius: 12px;
}

.notification-item {
    border-bottom: 1px solid #eaecf0;
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item-unread {
    border-left: 3px solid #6f642d;
    background: #fcfbf6;
}

.foundation-card {
    width: 100%;
    border-radius: 16px;
}

.language-switcher {
    white-space: nowrap;
}

.language-switcher .mud-button-root {
    min-width: 3.25rem;
}

.loading-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.laundry-entry-card {
    border-color: #ddd9c8 !important;
    background: #fcfbf7;
}

.ui-focus-anchor {
    scroll-margin-top: 8.5rem;
    outline: none;
}

.laundry-photo-field {
    display: flex;
    min-height: 56px;
    flex-direction: column;
    gap: .35rem;
}

.laundry-photo-button {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: .5rem;
    padding: .55rem .85rem;
    border: 1px solid #6f642d;
    border-radius: 8px;
    color: #5a5227;
    cursor: pointer;
    font-weight: 600;
}

.laundry-photo-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.laundry-photo-selection {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.laundry-photo-selection img,
.laundry-photo-viewer img {
    display: block;
    max-width: min(100%, 480px);
    max-height: 360px;
    border-radius: 10px;
    object-fit: contain;
}

.laundry-photo-selection img {
    width: 88px;
    height: 88px;
    object-fit: cover;
}

.history-order-row {
    cursor: pointer;
}

.history-order-detail-heading,
.history-order-detail-cell {
    width: 3.25rem;
    text-align: right;
}

.laundry-draft-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.loading-mark {
    width: 48px;
    height: 48px;
    border: 5px solid #d0d5dd;
    border-top-color: #6f642d;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.75rem 3rem 0.75rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.75rem;
    border: 0;
    background: transparent;
    cursor: pointer;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .foundation-main {
        align-items: flex-start;
    }

    .app-main {
        padding-top: 56px;
    }

    .app-nav-region {
        top: 56px;
    }

    .app-topbar {
        padding-right: .75rem;
        padding-left: .75rem;
    }

    .app-topbar-logo {
        width: 3.35rem;
        height: 1.9rem;
        margin-right: .55rem !important;
    }

    .app-topbar-title {
        max-width: 8rem;
        overflow: hidden;
        font-size: 1rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-nav-container {
        padding-right: .5rem !important;
        padding-left: .5rem !important;
    }

    .app-nav {
        padding-top: .45rem;
        padding-bottom: .45rem;
    }

    .ui-focus-anchor {
        scroll-margin-top: 7.5rem;
    }

    .app-content {
        padding-top: 1rem !important;
    }

    .app-card {
        border-radius: 14px;
        box-shadow: 0 2px 8px rgba(16, 24, 40, .06) !important;
    }

    .app-card-brand {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .app-brand {
        gap: .75rem;
    }

    .app-brand-logo {
        width: 4.5rem;
        height: 2.6rem;
    }

    .mud-typography-h3 {
        font-size: 2rem !important;
    }

    .page-title.mud-typography-h4 {
        font-size: 1.75rem;
    }

    .home-heading {
        align-items: flex-start;
    }

    .page-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions .mud-button-root,
    .form-actions .mud-button-root {
        width: 100%;
    }

    .language-switcher .mud-typography-caption {
        display: none;
    }

    .language-switcher .mud-button-root {
        min-width: 2.75rem;
        padding-right: .6rem;
        padding-left: .6rem;
    }
}
