/* ============================================================
   Warehouse Checking - Collapsible Sidebar
   File tambahan: dimuat setelah warehouse.css
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 78px;
    --sidebar-bg: #111827;
    --sidebar-bg-soft: #1f2937;
    --sidebar-text: #dbe4ff;
    --sidebar-muted: #8f9bad;
    --sidebar-active: #1f5eff;
    --sidebar-border: rgba(255, 255, 255, .08);
    --app-header-height: 64px;
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 120;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--sidebar-bg);
    color: white;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 8px 0 30px rgba(15, 23, 42, .08);
    transition: width .22s ease, transform .22s ease;
}

.sidebar-brand {
    height: var(--app-header-height);
    flex: 0 0 var(--app-header-height);
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-link {
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.sidebar-brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--sidebar-active);
    color: white;
    font-size: .82rem;
    font-weight: 950;
    letter-spacing: .04em;
}

.sidebar-brand-text {
    min-width: 0;
    display: grid;
    line-height: 1.05;
    white-space: nowrap;
    transition: opacity .15s ease;
}

.sidebar-brand-text strong {
    font-size: .98rem;
}

.sidebar-brand-text small {
    margin-top: 4px;
    color: #9eabc0;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px 16px;
    scrollbar-width: thin;
    scrollbar-color: #374151 transparent;
}

.sidebar-section-label {
    margin: 14px 10px 7px;
    color: var(--sidebar-muted);
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .12em;
    white-space: nowrap;
    transition: opacity .15s ease;
}

.sidebar-section-label:first-child {
    margin-top: 3px;
}

.sidebar-link,
.sidebar-logout {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--sidebar-text);
    font: inherit;
    font-size: .9rem;
    font-weight: 750;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.sidebar-link:hover,
.sidebar-logout:hover {
    background: var(--sidebar-bg-soft);
    color: white;
}

.sidebar-link.is-active {
    background: var(--sidebar-active);
    color: white;
    box-shadow: 0 7px 18px rgba(31, 94, 255, .24);
}

.sidebar-icon {
    width: 34px;
    height: 30px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    color: currentColor;
    font-size: .70rem;
    font-weight: 950;
    letter-spacing: -.02em;
}

.sidebar-link.is-active .sidebar-icon {
    background: rgba(255, 255, 255, .16);
}

.sidebar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity .15s ease;
}

.sidebar-footer {
    padding: 12px 10px 14px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 6px 8px 11px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #334155;
    color: white;
    font-size: .84rem;
    font-weight: 950;
}

.sidebar-user-info {
    min-width: 0;
    display: grid;
    transition: opacity .15s ease;
}

.sidebar-user-info strong {
    overflow: hidden;
    color: white;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-info span {
    margin-top: 2px;
    color: var(--sidebar-muted);
    font-size: .68rem;
    font-weight: 800;
}

.sidebar-logout-form {
    margin: 0;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left .22s ease;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 90;
    min-height: var(--app-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, .95);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .035);
    backdrop-filter: blur(10px);
}

.app-header-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
}

.sidebar-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 10px;
    border: 1px solid #dbe1e8;
    border-radius: 10px;
    background: white;
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: #f8fafc;
    border-color: #c8d0da;
}

.sidebar-toggle span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: #111827;
}

.app-header-title {
    min-width: 0;
    display: grid;
}

.app-header-title strong {
    overflow: hidden;
    color: #111827;
    font-size: .95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header-title span {
    margin-top: 2px;
    color: #7b8492;
    font-size: .72rem;
}

.app-header-user {
    display: grid;
    justify-items: end;
    min-width: 0;
}

.app-header-user span {
    max-width: 240px;
    overflow: hidden;
    color: #374151;
    font-size: .82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header-user strong {
    margin-top: 2px;
    color: #7b8492;
    font-size: .67rem;
    letter-spacing: .08em;
}

.sidebar-backdrop {
    display: none;
}

body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-brand {
    padding-inline: 18px;
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .sidebar-section-label {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-logout {
    justify-content: center;
    padding-inline: 10px;
}

body.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding-inline: 0;
}

body.sidebar-collapsed .sidebar-brand-link {
    justify-content: center;
}

@media (max-width: 900px) {
    .app-sidebar {
        width: min(290px, calc(100vw - 54px));
        transform: translateX(-105%);
        box-shadow: 16px 0 44px rgba(15, 23, 42, .28);
    }

    .app-main,
    body.sidebar-collapsed .app-main {
        margin-left: 0;
    }

    body.sidebar-collapsed .app-sidebar {
        width: min(290px, calc(100vw - 54px));
    }

    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .sidebar-label,
    body.sidebar-collapsed .sidebar-user-info,
    body.sidebar-collapsed .sidebar-section-label {
        width: auto;
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-collapsed .sidebar-link,
    body.sidebar-collapsed .sidebar-logout {
        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar-user {
        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar-brand-link {
        justify-content: flex-start;
    }

    body.sidebar-mobile-open {
        overflow: hidden;
    }

    body.sidebar-mobile-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 110;
        border: 0;
        background: rgba(15, 23, 42, .46);
        backdrop-filter: blur(2px);
        cursor: pointer;
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        display: block;
    }

    .app-header {
        padding-inline: 12px;
    }

    .app-header-user span {
        max-width: 150px;
    }
}

@media (max-width: 600px) {
    .app-header-title span {
        display: none;
    }

    .app-header-user span {
        max-width: 110px;
        font-size: .76rem;
    }

    .app-header-user strong {
        font-size: .61rem;
    }
}

@media (max-width: 430px) {
    .app-header-user {
        display: none;
    }

    .app-header-title strong {
        max-width: calc(100vw - 92px);
    }
}
