.staff-mobile-tabs, .admin-mobile-signout, .admin-mobile-brand { display: none; }
.order-identity > a { width: max-content; max-width: 100%; color: var(--brand-blue); font-size: 11px; font-weight: 800; text-decoration: none; }
.order-row-actions > a, .history-actions > .history-view-link {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    min-height: 27px; padding: 4px 5px; border: 1px solid #d6deeb; border-radius: 5px;
    background: #fff; color: #32435f; font-size: 10px; font-weight: 700; text-decoration: none;
}
.order-row-actions > a.progress { color: var(--brand-blue); border-color: #a4b6ff; }
.order-detail-route [data-staff-back], .catalog-breadcrumb [data-staff-back] { display: inline-flex; align-items: center; gap: 6px; }
.order-detail-route [data-staff-back] .app-icon, .catalog-breadcrumb [data-staff-back] .app-icon { width: 16px; height: 16px; }

@media (max-width: 900px) {
    .app-shell {
        --staff-tabs-height: calc(60px + env(safe-area-inset-bottom, 0px));
        --staff-mobile-ink: #141d36;
        --staff-mobile-yellow: #fffb70;
        padding-bottom: var(--staff-tabs-height);
    }
    .app-shell .admin-topbar {
        height: 62px; gap: 9px; padding-inline: 12px;
        background: var(--staff-mobile-ink); border-bottom: 1px solid #36415d;
    }
    .admin-mobile-brand {
        display: grid; place-items: center; flex: 0 0 58px; height: 44px;
        border: 0; border-radius: 5px; padding: 2px; background: var(--staff-mobile-yellow); overflow: hidden;
    }
    .admin-mobile-brand img { display: block; width: 54px; height: auto; mix-blend-mode: multiply; }
    .app-shell .admin-topbar .admin-search {
        flex: 1; width: auto; max-width: 560px; min-width: 0; height: 44px; gap: 7px; padding-inline: 9px;
        background: #fff; border-color: transparent; border-radius: 6px;
    }
    .admin-search-results a { min-height: 44px; }
    .admin-topbar .admin-search:focus-within,
    .admin-mobile-brand:focus-visible,
    .admin-account .admin-notification-link:focus-visible { outline: 2px solid var(--staff-mobile-yellow); outline-offset: 2px; }
    .app-shell .admin-account .admin-notification-link {
        flex: none; width: 44px; height: 44px; color: #fff; background: #293553; border: 1px solid #4b5876;
    }
    .staff-mobile-tabs {
        position: fixed; inset: auto 0 0; z-index: 1070; display: flex; justify-content: center;
        min-height: var(--staff-tabs-height); padding: 5px 6px env(safe-area-inset-bottom, 0px);
        background: #fff; border-top: 1px solid #ced8e7; box-shadow: 0 -4px 16px #14213d0c;
    }
    .staff-mobile-tabs > :is(a,button) {
        display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        min-width: 0; min-height: 48px; max-width: 150px; padding: 3px; border: 0; border-radius: 6px;
        background: transparent; color: #44516a; text-decoration: none; font-size: 11px; font-weight: 650;
    }
    .staff-mobile-tabs > a[aria-current=page], .staff-mobile-tabs > button[aria-expanded=true] {
        color: #1a2480; background: #f0f2ff; font-weight: 800;
    }
    .staff-mobile-tabs > a[aria-current=page] .app-icon, .staff-mobile-tabs > button[aria-expanded=true] .app-icon {
        background: var(--staff-mobile-yellow);
        border-radius: 5px; outline: 3px solid var(--staff-mobile-yellow);
    }
    .staff-mobile-tabs .app-icon { width: 20px; height: 20px; flex: none; }
    .admin-account > :is(form,span) { display: none; }
    .admin-mobile-signout { display: block; margin: auto 12px 12px; padding-top: 12px; border-top: 1px solid #ffffff24; }
    .admin-mobile-signout button { display: flex; align-items: center; gap: 8px; min-height: 44px; background: transparent; color: #f8fbff; border: 0; }
    .app-shell .admin-sidebar:not(.is-mobile-open) { visibility: hidden; }
    .app-shell .admin-sidebar .admin-nav-link, .app-shell .admin-sidebar .admin-nav-children a { min-height: 44px; }
    .app-shell .admin-sidebar .admin-collapse { display: none; }
    .order-detail-route [data-staff-back], .catalog-breadcrumb [data-staff-back] { min-height: 44px; }
    .order-row-actions > a, .order-row-actions summary, .history-actions > .history-view-link { min-height: 44px; padding: 6px 9px; }
    .order-row-actions details > summary { width: 44px; }
    .order-row-actions details > div { top: 46px; }
    .order-row-actions details > div :is(a,button) { min-height: 40px; }
    .order-identity > a { font-size: 15px; }
    .order-identity .historical-label { justify-self: start; }
    .order-table-row .order-customer strong { font-size: 13px; }
    .order-workspace-actions :is(a,button) { min-height: 44px; }
    .order-detail-route [data-staff-back] {
        padding-inline: 10px; background: #fff; border: 1px solid #d7deed; border-radius: 6px;
        color: #253385; text-decoration: none;
    }
    .stock-workspace .workspace-header { flex-direction: column; align-items: stretch; }
    .stock-workspace .workspace-actions { flex-wrap: wrap; justify-content: start; }
    .stock-workspace .workspace-actions > :is(a,button) { min-height: 44px; }

    .past-orders-shell { grid-template-columns: minmax(0, 1fr); }
    .past-orders-shell > .orders-sidebar { display: none; }
    .past-orders-shell .past-orders-main { padding: 16px 12px; }
    .past-orders-main .past-header { display: flex; flex-wrap: wrap; gap: 12px; }
    .past-orders-main .past-header-actions { display: flex; flex-wrap: wrap; justify-content: start; }
    .past-orders-main :is(.history-kpi-grid,.history-analytics-grid,.history-list-surface,.history-filter-wrap,.history-table) { min-width: 0; }
    .past-orders-main .history-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .past-orders-main .history-kpi-card { grid-template-columns: minmax(0, 1fr); }
    .past-orders-main .history-kpi-copy { grid-template-columns: 24px minmax(0, 1fr); gap: 8px; }
    .past-orders-main .history-kpi-icon { width: 24px; height: 24px; }
    .past-orders-main .history-kpi-copy strong { font-size: 18px; overflow-wrap: anywhere; }
    .past-orders-main .history-analytics-grid { grid-template-columns: minmax(0, 1fr); }
    .past-orders-main .completion-body { grid-template-columns: 95px minmax(0, 1fr); gap: 10px; }
    .past-orders-main .donut-shell { width: 95px; height: 95px; }
    .past-orders-main .history-filter-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .past-orders-main .history-search, .past-orders-main .more-filters { grid-column: 1 / -1; }
    .past-orders-main .history-more-panel { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .past-orders-main .history-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; height: auto; min-height: 0; padding: 12px; }
    .past-orders-main .history-table-header { display: none; }
    .past-orders-main .history-customer { overflow-wrap: anywhere; }
    .past-orders-main .history-row :is(.history-phone, .history-items, .history-actions) { grid-column: 1 / -1; }
    .past-orders-main .history-actions > :is(a,span), .past-orders-main .history-actions .icon-action { min-width: 44px; min-height: 44px; }
    .past-orders-main .history-footer { flex-wrap: wrap; padding: 8px 12px; }
    .past-orders-main .pagination-controls { flex-wrap: wrap; }

    .catalog-table-wrap:has(.catalog-product-cell) { overflow: visible; }
    .catalog-table:has(.catalog-product-cell) :is(th,td):is(:nth-last-child(2),:nth-last-child(3),:nth-last-child(4),:nth-last-child(6),:nth-last-child(7)) { display: none; }
    .catalog-table:has(.catalog-product-cell) :is(th,td) { padding: 8px 5px; }
    .catalog-table .catalog-product-cell { white-space: normal; gap: 6px; }
    .catalog-table .catalog-product-cell > span { min-width: 0; overflow-wrap: anywhere; }
    .catalog-table .catalog-product-cell small { display: none; }
    .catalog-row-actions > a, .catalog-row-actions summary { min-width: 44px; min-height: 44px; }
}

@media (max-width: 760px) {
    .dashboard-command .dd-heading h1, .order-admin .order-page-header h1 { font-size: 29px; }
    .dashboard-command .dd-heading p, .order-admin .order-page-header p { display: none; }
    .dashboard-command .dd-actions .dd-panel-heading { margin-bottom: 12px; }
    .dashboard-command .dd-action-grid { gap: 7px; }
    .dashboard-command .dd-action-grid a {
        justify-content: start; gap: 6px; min-height: 64px; padding: 10px 4px 6px;
        line-height: 1.14; background: #f9fafc; border-color: #dce2ed; font-size: 12px;
    }
    .dashboard-command .dd-action-grid a:first-child {
        background: var(--staff-mobile-yellow); border-color: #dacf53; color: var(--staff-mobile-ink); font-weight: 800;
    }
    .dashboard-command .dd-action-grid a:first-child .app-icon { color: currentColor; }
    .dashboard-command .dd-alert { min-height: 54px; }
    .order-admin .order-page-actions > a { min-height: 44px; }
    .order-admin .order-type-tabs button { min-height: 44px; }
    .order-admin .order-search { min-height: 44px; }
    .order-admin .order-filter-row select { min-height: 42px; }
    .order-admin .order-results:has(.order-table) { border-color: transparent; background: transparent; box-shadow: none; }
    .order-admin .order-table .order-table-row {
        margin-bottom: 8px; padding: 12px; background: #fff; border: 1px solid #dce2ed; border-radius: 8px;
    }
    .order-table-row .order-row-actions { border-top: 1px solid #eef0f5; padding-top: 8px; }
    .order-table-row .order-row-actions > a { font-size: 11px; }
    .order-table-row .order-row-actions > a:first-child { background: #242cad; color: #fff; border-color: transparent; }
    .order-table-row .order-row-actions > a:first-child .app-icon { color: inherit; }
}

@media (max-width: 520px) {
    .admin-search input[type=search] { min-width: 0; font-size: 16px; }
    .order-workspace-actions { width: 100%; flex-wrap: wrap; }
    .order-workspace-actions :is(a,button) { flex: 1 1 auto; font-size: 12px; }
    .catalog-editor-header .catalog-actions { flex-wrap: wrap; }
}

@media print {
    .staff-mobile-tabs, .admin-mobile-signout { display: none !important; }
    .app-shell { padding-bottom: 0; }
}
