/*
 * UFD Mobile Layer v1
 * Frontend-only responsive layer.
 * Intentionally scoped away from .admin-shell so the admin panel keeps its
 * existing layout and styles untouched.
 */
html { -webkit-text-size-adjust: 100%; }

/* Hidden on desktop; revealed by the mobile breakpoint below. */
.mobile-nav-toggle {
    display: none;
}

@media (max-width: 760px) {
    .dashboard-shell:not(.admin-shell) {
        overflow-x: hidden;
    }
}

@media (max-width: 980px) {
    .dashboard-shell:not(.admin-shell) .home-hero-grid,
    .dashboard-shell:not(.admin-shell) .docs-hero,
    .dashboard-shell:not(.admin-shell) .api-hero-grid,
    .dashboard-shell:not(.admin-shell) .support-grid,
    .dashboard-shell:not(.admin-shell) .status-hero {
        min-width: 0;
    }

    .dashboard-shell:not(.admin-shell) img,
    .page-shell img {
        max-width: 100%;
        height: auto;
    }

    .dashboard-shell:not(.admin-shell) pre,
    .dashboard-shell:not(.admin-shell) code,
    .dashboard-shell:not(.admin-shell) .terminal-command,
    .dashboard-shell:not(.admin-shell) .hero-json {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .dashboard-shell:not(.admin-shell) pre {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 760px) {
    /* ===== Universal mobile navigation ===== */
    .dashboard-shell:not(.admin-shell) .premium-topbar {
        position: sticky;
        top: 0;
        width: 100%;
        min-height: 64px;
        height: auto;
        padding: 9px 12px;
        display: grid !important;
        grid-template-columns: minmax(0,1fr) auto auto;
        grid-template-areas:
            "brand toggle account"
            "nav nav nav";
        align-items: center;
        gap: 8px;
        z-index: 1000;
        box-shadow: 0 8px 24px rgba(18, 55, 35, .06);
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand.compact {
        grid-area: brand;
        min-width: 0;
        margin: 0;
        gap: 9px;
        overflow: hidden;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand-logo-image {
        width: 38px;
        height: 38px;
        max-width: 38px;
        object-fit: contain;
        flex: 0 0 38px;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand.compact h1,
    .dashboard-shell:not(.admin-shell) .premium-topbar .brand.compact p {
        display: none;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand-link {
        min-width: 0;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand-link:after {
        content: "Uzbek Foods";
        display: block;
        font-size: 13px;
        line-height: 1.1;
        font-weight: 850;
        letter-spacing: -.02em;
        color: #14251b;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav {
        grid-area: nav;
        display: none !important;
        width: 100%;
        max-width: none;
        margin: 2px 0 0;
        padding: 4px;
        gap: 4px;
        align-items: stretch;
        justify-content: stretch;
        flex-direction: column;
        overflow: visible;
        border: 1px solid rgba(218, 231, 223, .95);
        border-radius: 18px;
        background: rgba(255,255,255,.98);
        box-shadow: 0 18px 40px rgba(20, 72, 43, .10);
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar.mobile-nav-open .main-nav {
        display: flex !important;
        animation: ufdMobileNavIn .18s ease-out both;
    }

    /* style.css contains a desktop navigation rule with !important; keep the
       closed mobile state authoritative so the drawer cannot remain visible. */
    .dashboard-shell:not(.admin-shell) .premium-topbar:not(.mobile-nav-open) .main-nav {
        display: none !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link {
        width: 100%;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 13px;
        font-size: 13px;
        line-height: 1.2;
        white-space: normal;
        -webkit-tap-highlight-color: transparent;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link .nav-icon {
        flex: 0 0 18px;
    }

    .mobile-nav-toggle {
        grid-area: toggle;
        width: 42px;
        height: 42px;
        display: inline-grid;
        place-items: center;
        padding: 0;
        border: 1px solid #dce8e0;
        border-radius: 13px;
        color: #20352a;
        background: rgba(255,255,255,.9);
        box-shadow: 0 7px 18px rgba(16, 72, 41, .06);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-toggle:active {
        transform: translateY(1px);
    }

    .mobile-nav-toggle svg {
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform .18s ease;
    }

    .mobile-nav-toggle.is-open svg {
        transform: rotate(90deg);
    }

    .dashboard-shell:not(.admin-shell) .account-menu-wrap {
        grid-area: account;
    }

    .dashboard-shell:not(.admin-shell) .account-menu-btn {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .dashboard-shell:not(.admin-shell) .account-menu {
        top: calc(100% + 9px);
        right: 0;
        width: min(240px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
    }

    /* ===== Main shells / spacing ===== */
    .dashboard-shell:not(.admin-shell) .home-hero,
    .dashboard-shell:not(.admin-shell) .docs-main,
    .dashboard-shell:not(.admin-shell) .api-main,
    .dashboard-shell:not(.admin-shell) .status-main,
    .dashboard-shell:not(.admin-shell) .support-main {
        min-width: 0;
    }

    .dashboard-shell:not(.admin-shell) .home-hero {
        padding: 46px 0 26px;
    }

    .dashboard-shell:not(.admin-shell) .home-hero-grid,
    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-hero-grid {
        width: min(100% - 24px, 760px);
        gap: 30px;
    }

    .dashboard-shell:not(.admin-shell) .home-hero-copy,
    .dashboard-shell:not(.admin-shell) .api-hero-copy,
    .dashboard-shell:not(.admin-shell) .docs-hero-copy,
    .dashboard-shell:not(.admin-shell) .status-hero-copy,
    .dashboard-shell:not(.admin-shell) .support-hero-copy {
        max-width: none;
        min-width: 0;
    }

    .dashboard-shell:not(.admin-shell) .home-hero h2,
    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-hero h2,
    .dashboard-shell:not(.admin-shell) .status-hero h2,
    .dashboard-shell:not(.admin-shell) .support-hero h2 {
        font-size: clamp(34px, 10vw, 48px);
        line-height: 1.02;
        letter-spacing: -.045em;
    }

    .dashboard-shell:not(.admin-shell) .home-hero-grid,
    .dashboard-shell:not(.admin-shell) .story-data-card,
    .dashboard-shell:not(.admin-shell) .detail-grid,
    .dashboard-shell:not(.admin-shell) .guide-slide,
    .dashboard-shell:not(.admin-shell) .playground-shell,
    .dashboard-shell:not(.admin-shell) .response-grid {
        min-width: 0;
    }

    /* ===== Hero / cards ===== */
    .dashboard-shell:not(.admin-shell) .hero-actions,
    .dashboard-shell:not(.admin-shell) .docs-hero-actions,
    .dashboard-shell:not(.admin-shell) .api-hero-actions,
    .dashboard-shell:not(.admin-shell) .cta-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
        width: 100%;
    }

    .dashboard-shell:not(.admin-shell) .hero-actions > *,
    .dashboard-shell:not(.admin-shell) .docs-hero-actions > *,
    .dashboard-shell:not(.admin-shell) .api-hero-actions > *,
    .dashboard-shell:not(.admin-shell) .cta-actions > * {
        width: 100%;
        min-width: 0;
    }

    .dashboard-shell:not(.admin-shell) .hero-trust {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dashboard-shell:not(.admin-shell) .hero-visual {
        min-height: 280px;
        width: 100%;
        overflow: hidden;
    }

    .dashboard-shell:not(.admin-shell) .feature-grid,
    .dashboard-shell:not(.admin-shell) .status-grid,
    .dashboard-shell:not(.admin-shell) .database-metrics,
    .dashboard-shell:not(.admin-shell) .support-grid,
    .dashboard-shell:not(.admin-shell) .docs-ai-grid,
    .dashboard-shell:not(.admin-shell) .api-step-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-shell:not(.admin-shell) .feature-card,
    .dashboard-shell:not(.admin-shell) .premium-feature-card,
    .dashboard-shell:not(.admin-shell) .status-card,
    .dashboard-shell:not(.admin-shell) .api-step-card,
    .dashboard-shell:not(.admin-shell) .docs-card,
    .dashboard-shell:not(.admin-shell) .state-card {
        min-width: 0;
    }

    /* ===== Docs ===== */
    .dashboard-shell:not(.admin-shell) .docs-main {
        width: calc(100% - 20px);
        padding-top: 20px;
    }

    .dashboard-shell:not(.admin-shell) .docs-hero {
        grid-template-columns: 1fr;
        padding: 24px 18px;
        border-radius: 24px;
    }

    .dashboard-shell:not(.admin-shell) .docs-hero-card {
        min-width: 0;
        overflow: hidden;
    }

    .dashboard-shell:not(.admin-shell) .docs-table-wrap,
    .dashboard-shell:not(.admin-shell) .table-scroll,
    .dashboard-shell:not(.admin-shell) .simple-table-scroll,
    .dashboard-shell:not(.admin-shell) .api-key-table {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
    }

    .dashboard-shell:not(.admin-shell) .docs-table,
    .dashboard-shell:not(.admin-shell) .simple-data-table,
    .dashboard-shell:not(.admin-shell) .api-key-table table,
    .dashboard-shell:not(.admin-shell) table {
        min-width: 620px;
    }

    /* ===== API ===== */
    .dashboard-shell:not(.admin-shell) .api-main,
    .dashboard-shell:not(.admin-shell) .api-main-v46 {
        width: 100%;
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-statbar,
    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-key-section,
    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-section,
    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-compact-section,
    .dashboard-shell:not(.admin-shell) .api-live-monitor,
    .dashboard-shell:not(.admin-shell) .api-footer {
        width: calc(100% - 20px);
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-key-grid,
    .dashboard-shell:not(.admin-shell) .api-main-v46 .response-grid,
    .dashboard-shell:not(.admin-shell) .api-main-v46 .playground-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-key-head {
        align-items: flex-start;
        gap: 8px;
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-terminal-card,
    .dashboard-shell:not(.admin-shell) .api-terminal-card,
    .dashboard-shell:not(.admin-shell) .code-lab,
    .dashboard-shell:not(.admin-shell) .code-panel,
    .dashboard-shell:not(.admin-shell) .response-code {
        width: 100%;
        min-width: 0;
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .endpoint-card,
    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-endpoints-v46 .endpoint-card {
        display: block;
        min-width: 0;
        padding: 13px;
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .endpoint-top {
        flex-wrap: wrap;
        min-width: 0;
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .endpoint-top code {
        white-space: normal;
        word-break: break-word;
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .endpoint-meta {
        flex-wrap: wrap;
        margin-top: 10px;
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-statbar {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-shell:not(.admin-shell) .playground-controls,
    .dashboard-shell:not(.admin-shell) .playground-response,
    .dashboard-shell:not(.admin-shell) .playground-dynamic,
    .dashboard-shell:not(.admin-shell) .api-base-card,
    .dashboard-shell:not(.admin-shell) .api-key-create-card,
    .dashboard-shell:not(.admin-shell) .api-key-list-card {
        min-width: 0;
        max-width: 100%;
    }

    /* ===== Database ===== */
    .dashboard-shell:not(.admin-shell) .database-hero-premium {
        margin-inline: 10px;
        border-radius: 24px;
        padding: 24px 18px;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dashboard-shell:not(.admin-shell) .database-hero-orbit {
        width: 175px;
        height: 175px;
    }

    .dashboard-shell:not(.admin-shell) .database-metrics {
        padding-inline: 10px;
        gap: 10px;
    }

    .dashboard-shell:not(.admin-shell) .data-card {
        border-radius: 18px;
    }

    /* ===== Support ===== */
    .dashboard-shell:not(.admin-shell) .support-main {
        width: calc(100% - 16px);
        padding-top: 12px;
    }

    .dashboard-shell:not(.admin-shell) .support-hero {
        padding: 24px 16px;
        border-radius: 24px;
    }

    .dashboard-shell:not(.admin-shell) .support-hero-visual {
        min-height: 190px;
        overflow: hidden;
    }

    .dashboard-shell:not(.admin-shell) .support-compose,
    .dashboard-shell:not(.admin-shell) .support-history,
    .dashboard-shell:not(.admin-shell) .support-guide {
        min-width: 0;
    }

    /* ===== Status ===== */
    .dashboard-shell:not(.admin-shell) .status-main {
        width: calc(100% - 16px);
        padding-top: 12px;
    }

    .dashboard-shell:not(.admin-shell) .status-hero {
        padding: 24px 16px;
        border-radius: 24px;
    }

    .dashboard-shell:not(.admin-shell) .status-orbit {
        width: 190px;
        height: 190px;
        justify-self: center;
    }

    .dashboard-shell:not(.admin-shell) .status-foot-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-shell:not(.admin-shell) .status-status-list {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-shell:not(.admin-shell) .status-latency-panel,
    .dashboard-shell:not(.admin-shell) .status-chart-wrap {
        min-width: 0;
    }

    /* ===== Footer ===== */
    .dashboard-shell:not(.admin-shell) .home-footer {
        width: calc(100% - 24px);
    }

    /* ===== Authentication / registration ===== */
    .page-shell.register-page-shell {
        min-height: 100svh;
        padding: 16px 10px;
        justify-content: flex-start;
    }

    .page-shell .register-card,
    .page-shell .register-card-pro {
        width: 100%;
        max-width: 680px;
        padding: 24px 16px;
        border-radius: 22px;
        margin-block: auto;
    }

    .page-shell .brand-register {
        gap: 10px;
        margin-bottom: 22px;
    }

    .page-shell .brand-register .brand-logo-image {
        width: 44px;
        max-width: 44px;
        flex: 0 0 44px;
    }

    .page-shell .brand-register h1 {
        font-size: 18px;
        line-height: 1.15;
    }

    .page-shell .brand-register p {
        font-size: 11px;
    }

    .page-shell .step-indicator-pro {
        margin-bottom: 24px;
    }

    .page-shell .step-indicator-pro .line {
        margin-inline: 7px;
    }

    .page-shell .register-card-pro h2 {
        font-size: 26px;
    }

    .page-shell input[type="text"],
    .page-shell input[type="password"],
    .page-shell input[type="email"],
    .page-shell textarea,
    .page-shell select,
    .page-shell button,
    .page-shell .primary-btn,
    .page-shell .secondary-btn {
        font-size: 16px;
    }

    .page-shell .register-textarea {
        font-size: 16px;
    }

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

    .page-shell .actions .primary-btn,
    .page-shell .actions .secondary-btn,
    .page-shell .register-card-pro .actions .primary-btn,
    .page-shell .register-card-pro .actions .secondary-btn {
        width: 100%;
    }

    .page-shell .date-grid,
    .page-shell .date-grid-pro {
        grid-template-columns: 1fr;
    }

    .page-shell .footer-note {
        text-align: center;
    }
}

@media (max-width: 430px) {
    .dashboard-shell:not(.admin-shell) .premium-topbar {
        padding-inline: 9px;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand-link:after {
        font-size: 12px;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand-logo-image {
        width: 36px;
        height: 36px;
        max-width: 36px;
        flex-basis: 36px;
    }

    .mobile-nav-toggle,
    .dashboard-shell:not(.admin-shell) .account-menu-btn {
        width: 40px;
        height: 40px;
    }

    .dashboard-shell:not(.admin-shell) .api-main-v46 .api-statbar,
    .dashboard-shell:not(.admin-shell) .status-status-list {
        grid-template-columns: 1fr;
    }

    .dashboard-shell:not(.admin-shell) .status-status-list > div {
        border-right: 0;
        border-bottom: 1px solid #edf2ee;
    }

    .dashboard-shell:not(.admin-shell) .status-status-list > div:last-child {
        border-bottom: 0;
    }

    .page-shell .step-indicator-pro .step {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .page-shell .step-indicator-pro .line {
        height: 3px;
        margin-inline: 5px;
    }
}

@keyframes ufdMobileNavIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-shell:not(.admin-shell) .premium-topbar.mobile-nav-open .main-nav {
        animation: none;
    }
}

/* ================================================================
   UFD MOBILE DRAWER v3 — premium side navigation
   Frontend only. Desktop + admin remain untouched.
   ================================================================ */
@media (max-width: 760px) {
    body.mobile-nav-lock {
        overflow: hidden;
        touch-action: none;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar {
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        grid-template-areas: "brand toggle account" !important;
        grid-template-rows: auto !important;
        min-height: 64px;
        z-index: 1010;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav {
        grid-area: auto !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: min(340px, 88vw) !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        padding: 88px 16px 24px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 7px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
        border: 0 !important;
        border-left: 1px solid rgba(210, 225, 216, .95) !important;
        border-radius: 28px 0 0 28px !important;
        background: rgba(255, 255, 255, .975) !important;
        box-shadow: -24px 0 70px rgba(15, 35, 25, .16), -3px 0 0 rgba(255,255,255,.65) inset;
        backdrop-filter: blur(20px) saturate(120%);
        -webkit-backdrop-filter: blur(20px) saturate(120%);
        transform: translate3d(105%, 0, 0) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition:
            transform .34s cubic-bezier(.22, .8, .2, 1),
            opacity .24s ease,
            visibility 0s linear .34s;
        z-index: 1004 !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav::before {
        content: "Asosiy menyu";
        display: block;
        position: absolute;
        top: 26px;
        left: 20px;
        right: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #edf2ee;
        color: #183a28;
        font-size: 14px;
        font-weight: 850;
        letter-spacing: -.02em;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav::after {
        content: "";
        position: absolute;
        top: 63px;
        left: 20px;
        width: 34px;
        height: 3px;
        border-radius: 999px;
        background: #159447;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar.mobile-nav-open .main-nav {
        transform: translate3d(0, 0, 0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transition-delay: 0s, 0s, 0s;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link {
        flex: 0 0 auto;
        min-height: 54px;
        height: auto;
        width: 100%;
        padding: 13px 14px;
        border: 1px solid transparent;
        border-radius: 16px;
        background: transparent;
        color: #58685f;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 13px;
        font-size: 14px;
        font-weight: 760;
        box-sizing: border-box;
        transform: translateX(0);
        transition:
            background .18s ease,
            border-color .18s ease,
            color .18s ease,
            transform .18s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link:hover,
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link:focus-visible {
        background: #f2f8f4;
        border-color: #e1eee6;
        color: #136b3b;
        transform: translateX(-2px);
        outline: none;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link.active {
        background: linear-gradient(180deg, #edf9f1 0%, #e7f5eb 100%);
        border-color: #cae7d3;
        color: #087233;
        box-shadow: 0 8px 24px rgba(21, 148, 71, .08);
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link .nav-icon {
        width: 20px !important;
        height: 20px !important;
        flex: 0 0 20px !important;
    }

    .dashboard-shell:not(.admin-shell) .mobile-nav-toggle {
        position: relative;
        z-index: 1006;
        flex: 0 0 auto;
    }

    .dashboard-shell:not(.admin-shell) .mobile-nav-toggle.is-open svg {
        transform: rotate(0deg) !important;
    }

    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(13, 28, 20, .24);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .28s ease, visibility 0s linear .28s;
        z-index: 1003;
    }

    .mobile-nav-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s, 0s;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar.mobile-nav-open .mobile-nav-toggle {
        border-color: #cfe4d6;
        background: rgba(255,255,255,.98);
        box-shadow: 0 10px 28px rgba(16, 72, 41, .12);
    }

    @media (prefers-reduced-motion: reduce) {
        .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav,
        .mobile-nav-backdrop,
        .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link {
            transition: none !important;
        }
    }
}

/* Final v3 polish: keep the drawer below the mobile header and force a stable
   left-aligned navigation rhythm despite legacy desktop !important rules. */
@media (max-width: 760px) {
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav {
        top: 64px !important;
        bottom: 0 !important;
        height: auto !important;
        min-height: calc(100dvh - 64px) !important;
        max-height: calc(100dvh - 64px) !important;
        width: min(320px, 82vw) !important;
        padding: 76px 16px 24px !important;
        border-radius: 26px 0 0 0 !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link {
        justify-content: flex-start !important;
        padding: 13px 14px !important;
        min-height: 54px !important;
        width: 100% !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav::before {
        top: 22px;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav::after {
        top: 59px;
    }

    .mobile-nav-backdrop {
        top: 64px;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link:nth-child(1) { animation-delay: .03s; }
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link:nth-child(2) { animation-delay: .06s; }
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link:nth-child(3) { animation-delay: .09s; }
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link:nth-child(4) { animation-delay: .12s; }
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link:nth-child(5) { animation-delay: .15s; }
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link:nth-child(6) { animation-delay: .18s; }

    .dashboard-shell:not(.admin-shell) .premium-topbar.mobile-nav-open .main-nav .nav-link {
        animation: ufdDrawerItemIn .32s cubic-bezier(.22,.8,.2,1) both;
    }

    @keyframes ufdDrawerItemIn {
        from { opacity: 0; transform: translate3d(14px, 0, 0); }
        to { opacity: 1; transform: translate3d(0, 0, 0); }
    }
}


/* ================================================================
   UFD MOBILE HEADER V4 — left drawer + hamburger-first header
   Mobile only. Desktop/admin untouched.
   ================================================================ */
@media (max-width: 760px) {
    /* Header order: hamburger LEFT, brand beside it, account dots removed. */
    .dashboard-shell:not(.admin-shell) .premium-topbar {
        grid-template-columns: 42px minmax(0, 1fr) !important;
        grid-template-areas: "toggle brand" !important;
        gap: 10px !important;
        padding: 9px 12px !important;
        min-height: 64px !important;
        height: auto !important;
        align-items: center !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle {
        grid-area: toggle !important;
        justify-self: start !important;
        align-self: center !important;
        width: 42px !important;
        height: 42px !important;
        border-radius: 13px !important;
        order: initial !important;
        margin: 0 !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand.compact {
        grid-area: brand !important;
        justify-self: start !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        gap: 9px !important;
        display: flex !important;
        align-items: center !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand-link:after {
        display: none !important;
        content: none !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand.compact h1 {
        display: block !important;
        margin: 0 !important;
        font-size: 13px !important;
        line-height: 1.08 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand.compact p {
        display: none !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .brand-logo-image {
        width: 38px !important;
        height: 38px !important;
        max-width: 38px !important;
        flex: 0 0 38px !important;
    }

    /* Three-dot account button is intentionally removed from mobile header. */
    .dashboard-shell:not(.admin-shell) .premium-topbar .account-menu-wrap {
        display: none !important;
    }

    /* Left-side drawer. */
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav {
        top: 64px !important;
        right: auto !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(330px, 84vw) !important;
        min-height: calc(100dvh - 64px) !important;
        height: auto !important;
        max-height: calc(100dvh - 64px) !important;
        padding: 76px 16px 24px !important;
        border-left: 0 !important;
        border-right: 1px solid rgba(210, 225, 216, .95) !important;
        border-radius: 0 26px 26px 0 !important;
        transform: translate3d(-105%, 0, 0) !important;
        box-shadow: 24px 0 70px rgba(15, 35, 25, .16), 3px 0 0 rgba(255,255,255,.72) inset !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar.mobile-nav-open .main-nav {
        transform: translate3d(0, 0, 0) !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav::before {
        left: 20px !important;
        right: 20px !important;
        text-align: left !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav::after {
        left: 20px !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .nav-link {
        justify-content: flex-start !important;
        text-align: left !important;
    }

    /* Mobile logout item lives inside the drawer, not as a three-dot menu. */
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .mobile-only-logout {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 13px !important;
        margin-top: auto !important;
        min-height: 54px !important;
        padding: 13px 14px !important;
        border: 1px solid rgba(191, 218, 201, .9) !important;
        border-radius: 16px !important;
        background: #fff !important;
        color: #a12a2a !important;
        box-shadow: 0 8px 22px rgba(42, 72, 53, .06) !important;
        text-decoration: none !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .mobile-only-logout:hover,
    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .mobile-only-logout:focus-visible {
        background: #fff6f6 !important;
        border-color: #efc8c8 !important;
        color: #a01f1f !important;
        outline: none !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .main-nav .mobile-only-logout .logout-icon {
        width: 20px !important;
        height: 20px !important;
        flex: 0 0 20px !important;
        fill: none !important;
        stroke: currentColor !important;
        stroke-width: 1.8 !important;
        stroke-linecap: round !important;
        stroke-linejoin: round !important;
    }

    .dashboard-shell:not(.admin-shell) .mobile-nav-backdrop {
        top: 64px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }

    /* Allow opening gesture from the LEFT edge because the drawer is left-side. */
    .dashboard-shell:not(.admin-shell) .premium-topbar.mobile-nav-open .mobile-nav-toggle {
        border-color: #cfe4d6 !important;
        background: rgba(255,255,255,.98) !important;
    }
}

@media (min-width: 761px) {
    .mobile-only-logout { display: none !important; }
}

/* ================================================================
   UFD MOBILE HAMBURGER V5 — precision / premium control
   Mobile frontend only. No desktop/admin styles are touched.
   ================================================================ */
@media (max-width: 760px) {
    .dashboard-shell:not(.admin-shell) .premium-topbar {
        grid-template-columns: 48px minmax(0, 1fr) !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 0 !important;
        display: grid !important;
        place-items: center !important;
        position: relative !important;
        overflow: hidden !important;
        border: 1px solid rgba(20, 94, 53, .14) !important;
        border-radius: 50% !important;
        color: #18372a !important;
        background:
            radial-gradient(circle at 28% 18%, rgba(255,255,255,.98), transparent 46%),
            linear-gradient(145deg, #ffffff 0%, #f7fbf8 100%) !important;
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.98),
            inset 0 -1px 0 rgba(20,94,53,.035),
            0 1px 2px rgba(18,48,31,.05),
            0 10px 26px rgba(16,72,41,.075) !important;
        transition:
            transform .18s cubic-bezier(.22,.8,.2,1),
            border-color .18s ease,
            background .18s ease,
            box-shadow .18s ease,
            color .18s ease !important;
        isolation: isolate;
        -webkit-tap-highlight-color: transparent;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle::before {
        content: "";
        position: absolute;
        inset: 1px;
        border: 1px solid rgba(255,255,255,.76);
        border-radius: 50%;
        pointer-events: none;
        opacity: .92;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle::after {
        content: "";
        position: absolute;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: rgba(28, 155, 78, .055);
        filter: blur(9px);
        opacity: 0;
        transition: opacity .18s ease;
        pointer-events: none;
        z-index: -1;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle:hover {
        transform: translateY(-1px);
        border-color: rgba(21, 148, 71, .24) !important;
        color: #0d7f40 !important;
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.98),
            0 3px 7px rgba(18,48,31,.05),
            0 14px 30px rgba(16,72,41,.095) !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle:hover::after,
    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle:focus-visible::after {
        opacity: 1;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle:focus-visible {
        outline: none !important;
        border-color: rgba(21, 148, 71, .38) !important;
        box-shadow:
            0 0 0 4px rgba(21,148,71,.11),
            inset 0 1px 0 rgba(255,255,255,.98),
            0 12px 28px rgba(16,72,41,.09) !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle:active {
        transform: scale(.965) !important;
        box-shadow:
            inset 0 2px 5px rgba(18,48,31,.075),
            0 4px 12px rgba(16,72,41,.07) !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-icon {
        width: 22px;
        height: 18px;
        position: relative;
        display: block;
        flex: 0 0 22px;
        color: currentColor;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-icon::before,
    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-icon::after,
    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-bar {
        content: "";
        position: absolute;
        left: 50%;
        height: 1.8px;
        border-radius: 999px;
        background: currentColor;
        box-shadow: 0 .5px 0 rgba(255,255,255,.45);
        transform-origin: center;
        transition:
            transform .25s cubic-bezier(.22,.8,.2,1),
            width .2s ease,
            top .25s cubic-bezier(.22,.8,.2,1),
            opacity .16s ease;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-icon::before {
        top: 1px;
        width: 18px;
        transform: translateX(-50%);
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-bar {
        top: 8.1px;
        width: 13px;
        transform: translateX(-50%);
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-icon::after {
        top: 15.2px;
        width: 18px;
        transform: translateX(-50%);
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle.is-open .mobile-nav-icon::before {
        top: 8.1px;
        transform: translateX(-50%) rotate(45deg);
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle.is-open .mobile-nav-bar {
        width: 18px;
        transform: translateX(-50%) scaleX(.15);
        opacity: 0;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle.is-open .mobile-nav-icon::after {
        top: 8.1px;
        transform: translateX(-50%) rotate(-45deg);
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar.mobile-nav-open .mobile-nav-toggle {
        color: #0a7138 !important;
        border-color: rgba(21,148,71,.26) !important;
        background: linear-gradient(145deg, #ffffff 0%, #f3faf5 100%) !important;
        box-shadow:
            0 0 0 3px rgba(21,148,71,.065),
            inset 0 1px 0 rgba(255,255,255,.98),
            0 12px 28px rgba(16,72,41,.105) !important;
    }
}

@media (max-width: 430px) {
    .dashboard-shell:not(.admin-shell) .premium-topbar {
        grid-template-columns: 46px minmax(0, 1fr) !important;
    }

    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        min-height: 46px !important;
        border-radius: 50% !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle,
    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-icon::before,
    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-bar,
    .dashboard-shell:not(.admin-shell) .premium-topbar .mobile-nav-toggle .mobile-nav-icon::after {
        transition: none !important;
    }
}

