/* ============================================================
   v8.0.10 - Desktop Dashboard Width / Outbound Request Naming
   PC는 관리자/조회용으로 전체 가용 폭을 사용한다.
   ============================================================ */

.dashboard-grid-single {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) !important;
}

.dashboard-grid-single > .panel {
    width: 100%;
    min-width: 0;
}

@media (min-width: 1025px) {
    .dashboard-page .content {
        width: 100%;
        max-width: 1680px;
        padding: 30px;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .dashboard-page .desktop-dashboard {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .dashboard-page .dashboard-grid-single {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .dashboard-page .dashboard-grid-single > .panel {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    /* 최근 출고 요청은 PC에서 가로 폭을 충분히 사용 */
    .dashboard-page .dashboard-responsive-table {
        width: 100%;
        min-width: 760px;
        table-layout: auto;
    }

    .dashboard-page .dashboard-grid-single .table-wrap {
        width: 100%;
        overflow-x: auto;
    }
}


/* ============================================================
   v8.0.11 - PC Top Navigation + Storage QR
   Mobile/PDA remains the primary operating UI.
   ============================================================ */

.desktop-global-nav {
    display: none;
}

/* QR stock lookup */
.qr-target-banner {
    border-color: #c8d9f6;
    background: #f3f7ff;
}

.qr-readonly-notice {
    margin: 12px;
    padding: 14px;
    border: 1px solid #d8e1ef;
    border-radius: 11px;
    background: #f8fafc;
}

.qr-readonly-notice strong,
.qr-readonly-notice span {
    display: block;
}

.qr-readonly-notice strong {
    color: #31435d;
    font-size: 11px;
}

.qr-readonly-notice span {
    margin-top: 4px;
    color: #718095;
    font-size: 10px;
    line-height: 1.55;
}

.qr-stock-card {
    grid-template-columns:
        minmax(145px, .85fr)
        minmax(170px, 1.2fr)
        minmax(170px, 1fr)
        minmax(250px, 1.35fr);
}

.scan-stock-code strong {
    overflow-wrap: anywhere;
}

.scan-stock-meta strong {
    display: block;
    margin-top: 4px;
    color: #33465f;
    font-size: 10px;
}

.qr-live-qty {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.qr-live-qty > div {
    min-width: 0;
    padding: 9px;
    border: 1px solid #e0e6ef;
    border-radius: 9px;
    background: #f8fafc;
}

.qr-live-qty span,
.qr-live-qty strong {
    display: block;
}

.qr-live-qty span {
    color: #7d8999;
    font-size: 8px;
}

.qr-live-qty strong {
    margin-top: 3px;
    color: #31435d;
    font-size: 12px;
}

.qr-live-qty .available {
    border-color: #cde6db;
    background: #f1faf6;
}

.qr-live-qty .available strong {
    color: #157552;
}

/* QR print label */
.qr-part-label {
    display: grid;
    grid-template-columns: 27mm minmax(0, 1fr);
    gap: 2mm;
    align-items: center;
}

.qr-label-code {
    display: grid;
    place-items: center;
    min-width: 0;
}

.part-storage-qr {
    display: block;
    width: 25mm;
    height: 25mm;
}

.qr-label-info {
    min-width: 0;
    overflow: hidden;
}

.qr-label-storage {
    margin: 1mm 0;
    overflow: hidden;
    color: #000;
    font-size: 7pt;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-label-semics {
    margin-top: 1mm;
}

.qr-label-semics span,
.qr-label-semics strong {
    display: block;
}

.qr-label-semics span {
    font-size: 5.5pt;
    font-weight: 700;
}

.qr-label-semics strong {
    margin-top: .4mm;
    overflow: hidden;
    font-size: 7.5pt;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   Desktop: side navigation is replaced by a horizontal top nav.
   ------------------------------------------------------------ */
@media (min-width: 1025px) {
    .app-shell {
        display: block;
    }

    .sidebar,
    .sidebar-backdrop,
    .topbar,
    .cs-scope-bar {
        display: none !important;
    }

    .main {
        width: 100%;
        min-height: 100vh;
        margin-left: 0;
    }

    .desktop-global-nav {
        position: sticky;
        top: 0;
        z-index: 100;
        min-height: 70px;
        display: flex;
        align-items: stretch;
        gap: 18px;
        padding: 0 max(24px, calc((100vw - 1680px) / 2 + 24px));
        border-bottom: 1px solid #203047;
        background: #0f1b2d;
        color: #fff;
        box-shadow: 0 2px 10px rgba(15, 27, 45, .10);
    }

    .desktop-nav-brand {
        min-width: 185px;
        display: flex;
        align-items: center;
        gap: 10px;
        color: #fff;
        text-decoration: none;
    }

    .desktop-nav-mark {
        width: 36px;
        height: 36px;
        display: grid;
        place-items: center;
        border-radius: 9px;
        background: #fff;
        color: #0f1b2d;
        font-size: 18px;
        font-weight: 950;
    }

    .desktop-nav-brand > span:last-child strong,
    .desktop-nav-brand > span:last-child small {
        display: block;
    }

    .desktop-nav-brand strong {
        font-size: 16px;
        letter-spacing: .08em;
    }

    .desktop-nav-brand small {
        margin-top: 2px;
        color: #8f9db2;
        font-size: 9px;
    }

    .desktop-nav-menu {
        min-width: 0;
        display: flex;
        align-items: stretch;
        gap: 2px;
        flex: 1;
    }

    .desktop-nav-link {
        height: 70px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 0 15px;
        border: 0;
        border-bottom: 3px solid transparent;
        background: transparent;
        color: #c8d3e2;
        font-family: inherit;
        font-size: 12px;
        font-weight: 800;
        white-space: nowrap;
        text-decoration: none;
        cursor: pointer;
    }

    .desktop-nav-link:hover,
    .desktop-nav-link.active,
    .desktop-nav-dropdown.active > .desktop-nav-trigger {
        border-bottom-color: #4e7df0;
        color: #fff;
        background: rgba(255,255,255,.035);
    }

    .desktop-nav-trigger span {
        color: #7f8da1;
        font-size: 10px;
    }

    .desktop-nav-dropdown {
        position: relative;
        display: flex;
        align-items: stretch;
    }

    .desktop-nav-dropdown-menu {
        position: absolute;
        top: calc(100% - 1px);
        left: 0;
        width: 260px;
        display: none;
        padding: 8px;
        border: 1px solid #d9e0e9;
        border-radius: 0 0 11px 11px;
        background: #fff;
        box-shadow: 0 14px 34px rgba(13, 27, 45, .17);
    }

    .desktop-nav-dropdown-menu-right {
        left: auto;
        right: 0;
    }

    .desktop-nav-dropdown:hover .desktop-nav-dropdown-menu,
    .desktop-nav-dropdown:focus-within .desktop-nav-dropdown-menu {
        display: grid;
        gap: 3px;
    }

    .desktop-nav-dropdown-menu a {
        display: block;
        padding: 10px 11px;
        border-radius: 8px;
        color: #2e3d52;
        text-decoration: none;
    }

    .desktop-nav-dropdown-menu a:hover {
        background: #f2f6fd;
    }

    .desktop-nav-dropdown-menu strong,
    .desktop-nav-dropdown-menu small {
        display: block;
    }

    .desktop-nav-dropdown-menu strong {
        font-size: 11px;
    }

    .desktop-nav-dropdown-menu small {
        margin-top: 3px;
        color: #8490a0;
        font-size: 8.5px;
    }

    .desktop-nav-user {
        max-width: 285px;
        display: flex;
        align-items: center;
        gap: 12px;
        margin-left: auto;
    }

    .desktop-nav-user > div {
        min-width: 0;
        text-align: right;
    }

    .desktop-nav-user strong,
    .desktop-nav-user small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .desktop-nav-user strong {
        color: #fff;
        font-size: 11px;
    }

    .desktop-nav-user small {
        margin-top: 3px;
        color: #8f9db2;
        font-size: 8px;
    }

    .desktop-nav-user > a {
        padding: 7px 9px;
        border: 1px solid #34445c;
        border-radius: 7px;
        color: #c3cfdf;
        font-size: 9px;
        text-decoration: none;
        white-space: nowrap;
    }

    .desktop-nav-user > a:hover {
        border-color: #5775a1;
        color: #fff;
    }

    .desktop-nav-user .logout-form { flex: 0 0 auto; }
    .desktop-nav-user .logout-form .logout-link {
        background: transparent;
        border: 1px solid #34445c;
        border-radius: 7px;
        color: #c3cfdf;
        font-size: 12px;
        line-height: 18px;
        width: auto;
        min-width: 70px;
        white-space: nowrap;
        writing-mode: horizontal-tb;
    }
    .desktop-nav-user .logout-form .logout-link:hover {
        background: #1e304a;
        border-color: #5775a1;
        color: #fff;
    }
}

/* ------------------------------------------------------------
   Mobile/PDA: QR stock lookup is the primary scan UI.
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
    .desktop-global-nav {
        display: none !important;
    }

    .qr-stock-card {
        grid-template-columns: 1fr !important;
    }

    .qr-live-qty {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .qr-live-qty > div {
        padding: 10px 7px;
    }

    .qr-live-qty span {
        font-size: 8px;
    }

    .qr-live-qty strong {
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .qr-live-qty {
        grid-template-columns: 1fr;
    }

    .qr-live-qty > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .qr-live-qty strong {
        margin-top: 0;
    }
}


/* ============================================================
   v8.0.13 - Mobile Home Navigation UX
   Home: ⋮ -> logout only
   Inner page: ‹ -> Dashboard home
   Mobile drawer/sidebar is not used.
   ============================================================ */

.mobile-page-identity,
.mobile-home-back,
.mobile-home-menu {
    display: none;
}

@media (max-width: 1024px) {
    /* Mobile navigation is tile-home based. Never show the old sidebar drawer. */
    .sidebar,
    .sidebar-backdrop {
        display: none !important;
    }

    body {
        overflow-x: hidden;
    }

    /* Home identity remains the existing SEMICS/user/storage header. */
    .mobile-home-identity {
        display: flex !important;
        min-width: 0;
        flex: 1;
    }

    /* Inner screens keep a home/back control alongside the account menu. */
    .mobile-home-back {
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        flex: 0 0 48px;
        margin-right: 4px;
        border: 0;
        border-radius: 12px;
        background: rgba(255,255,255,.08);
        color: #fff;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-home-back:active {
        background: rgba(255,255,255,.16);
        transform: translateY(1px);
    }

    .mobile-home-back > span {
        display: block;
        margin-top: -3px;
        font-size: 42px;
        font-weight: 300;
        line-height: 1;
    }

    .mobile-page-identity {
        min-width: 0;
        display: flex;
        flex: 1;
        flex-direction: column;
        justify-content: center;
        line-height: 1.2;
    }

    .mobile-page-identity strong {
        overflow: hidden;
        color: #fff;
        font-size: 16px;
        font-weight: 850;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-page-identity small {
        margin-top: 4px;
        overflow: hidden;
        color: rgba(255,255,255,.72);
        font-size: 9px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Shared mobile account menu. */
    .mobile-home-menu {
        position: relative;
        display: block;
        flex: 0 0 auto;
    }

    .mobile-home-menu > summary {
        list-style: none;
    }

    .mobile-home-menu > summary::-webkit-details-marker {
        display: none;
    }

    .mobile-home-menu .mobile-kebab {
        width: 44px;
        height: 48px;
        display: grid !important;
        place-items: center;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #fff;
        cursor: pointer;
        font-size: 30px;
        font-weight: 800;
        line-height: 1;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-home-menu[open] .mobile-kebab,
    .mobile-home-menu .mobile-kebab:active {
        background: rgba(255,255,255,.10);
    }

    .mobile-home-menu-popover {
        position: absolute;
        top: 52px;
        right: 0;
        z-index: 120;
        width: 220px;
        max-width: calc(100vw - 32px);
        box-sizing: border-box;
        padding: 6px;
        border: 1px solid #dce2ea;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 14px 34px rgba(15,27,45,.20);
    }

    .mobile-home-menu-popover a,
    .mobile-home-menu-popover .logout-link {
        width: 100%;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        color: #b42318;
        font-size: 13px;
        font-weight: 800;
        text-decoration: none;
    }

    .mobile-home-menu-popover a:active,
    .mobile-home-menu-popover .logout-link:active {
        background: #fff1f0;
    }

    .mobile-home-menu-popover .logout-form {
        width: 100%;
        margin: 0;
    }

    .mobile-home-menu-popover .logout-form .logout-link {
        width: 100%;
        min-width: 0;
        white-space: nowrap;
        writing-mode: horizontal-tb;
    }

    /* The old standalone kebab must never be visible on inner screens. */
    .topbar > .mobile-kebab {
        display: none !important;
    }
}

@media (max-width: 390px) {
    .mobile-home-back {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        margin-right: 2px;
    }

    .mobile-home-back > span {
        font-size: 38px;
    }

    .mobile-page-identity strong {
        font-size: 15px;
    }
}

@media (min-width: 1025px) {
    .mobile-page-identity,
    .mobile-home-back,
    .mobile-home-menu {
        display: none !important;
    }
}



/* Product lookup: warehouse stock and code-matched photos. */
.scan-photo-results { grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); }
.scan-photo-results > .panel { min-width: 0; }
.scan-photo-results .qr-stock-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scan-photo-results .qr-live-qty { grid-column: 1 / -1; }
.part-photo-gallery { display: grid; gap: 16px; padding: 16px; }
.part-photo-link { display: grid; gap: 12px; color: #60718b; text-align: center; text-decoration: none; font-size: 12px; }
.part-photo-link img { display: block; width: 100%; height: 300px; object-fit: contain; background: #f8fafc; border: 1px solid #e0e6ef; border-radius: 12px; }
.part-photo-link:focus-visible { outline: 3px solid #245ce5; outline-offset: 4px; border-radius: 12px; }
@media (max-width: 1024px) {
    .scan-photo-results { grid-template-columns: minmax(0, 1fr); }
    .part-photo-link img { height: 260px; }
}
