/* Shared nursery mobile primitives — loaded for all pages; rules scope to nursery shell / utilities */

:root {
    --nursery-nav-height: 64px;
    --nursery-touch: 44px;
}

/* ── Bottom tab bar ── */
.nursery-bottom-nav {
    display: none;
}

.nursery-more-sheet,
.nursery-more-backdrop {
    display: none;
}

body.nursery-ops .main-content {
    /* room for bottom nav on small screens; overridden below */
}

@media (max-width: 991.98px) {
    body.nursery-ops {
        padding-bottom: calc(var(--nursery-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    body.nursery-ops .main-content {
        padding-bottom: 0.5rem;
    }

    body.nursery-ops footer {
        display: none;
    }

    body.nursery-ops .navbar-toggler {
        display: none;
    }

    body.nursery-ops .navbar-collapse {
        display: none !important;
    }

    .nursery-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        height: calc(var(--nursery-nav-height) + env(safe-area-inset-bottom, 0px));
        padding: 0 0.25rem env(safe-area-inset-bottom, 0px);
        background: #fff;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 16px rgba(26, 47, 32, 0.06);
        align-items: stretch;
        justify-content: space-around;
    }

    .nursery-bottom-nav a,
    .nursery-bottom-nav button {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        min-height: var(--nursery-nav-height);
        border: none;
        background: transparent;
        color: var(--text-muted);
        text-decoration: none;
        font-family: var(--body-font);
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        padding: 0.35rem 0.25rem;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .nursery-bottom-nav a i,
    .nursery-bottom-nav button i {
        font-size: 1.15rem;
        line-height: 1;
    }

    .nursery-bottom-nav a.active,
    .nursery-bottom-nav button.active {
        color: var(--primary-green);
    }

    .nursery-more-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 100045;
        background: rgba(20, 30, 22, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .nursery-more-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    .nursery-more-sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100050;
        background: #fff;
        border-radius: 16px 16px 0 0;
        padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
        transform: translateY(110%);
        transition: transform 0.25s ease;
        max-height: min(78vh, 560px);
        overflow-y: auto;
        box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
    }

    .nursery-more-sheet.open {
        transform: translateY(0);
    }

    .nursery-more-sheet__handle {
        width: 36px;
        height: 4px;
        border-radius: 999px;
        background: #d5d8d2;
        margin: 0.15rem auto 0.85rem;
    }

    .nursery-more-sheet__title {
        font-family: var(--serif-font);
        font-size: 1rem;
        font-weight: 600;
        color: var(--primary-green);
        margin: 0 0 0.65rem;
    }

    .nursery-more-sheet__list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .nursery-more-sheet__list a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        min-height: var(--nursery-touch);
        padding: 0.65rem 0.75rem;
        border-radius: 10px;
        color: var(--text-main);
        text-decoration: none;
        font-weight: 600;
        font-size: 0.92rem;
    }

    .nursery-more-sheet__list a:hover,
    .nursery-more-sheet__list a:active {
        background: #f4f7f4;
        color: var(--primary-green);
    }

    .nursery-more-sheet__list a i {
        width: 1.25rem;
        text-align: center;
        color: var(--secondary-green);
    }

    .nursery-more-sheet__list a.is-danger {
        color: #b42318;
    }

    .nursery-more-sheet__list a.is-danger i {
        color: #b42318;
    }

    .nursery-more-sheet__divider {
        height: 1px;
        background: var(--border-color);
        margin: 0.45rem 0;
        border: none;
    }
}

/* ── Utility: cardified tables ── */
@media (max-width: 767.98px) {
    .m-card-table thead {
        display: none;
    }

    .m-card-table,
    .m-card-table tbody,
    .m-card-table tr {
        display: block;
        width: 100%;
        min-width: 0 !important;
    }

    .m-card-table tr {
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 0.65rem 0.75rem;
        margin-bottom: 0.65rem;
    }

    .m-card-table tr:has(td[colspan]) {
        border: none;
        padding: 0;
        background: transparent;
    }

    .m-card-table td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
        padding: 0.28rem 0 !important;
        border: none !important;
        white-space: normal !important;
        text-align: right !important;
        background: transparent !important;
        min-width: 0;
    }

    .m-card-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        text-align: left;
        flex-shrink: 0;
    }

    .m-card-table td:first-child {
        font-weight: 700;
        color: var(--text-main);
        padding-bottom: 0.45rem !important;
        margin-bottom: 0.25rem;
        border-bottom: 1px dashed #eef0ea !important;
    }

    .m-card-table-wrap {
        overflow: visible !important;
        border: none !important;
    }

    .m-touch-btn {
        min-height: var(--nursery-touch);
    }

    .m-filter-scroll {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.45rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.15rem;
    }

    .m-filter-scroll::-webkit-scrollbar {
        display: none;
    }
}
