/**
 * Kullanıcı / şirket panelleri — mobil uygulama benzeri deneyim
 * (çekmece menü, yapışkan üst çubuk, sekmeler yatay kaydırma)
 */

.pn-dash-mobile-toolbar {
    display: none;
}

/* JS ile eklenen satır; yalnızca mobil çekmecede görünsün (masaüstünde blok kalıp görünüyordu). */
.pn-dash-drawer-close-bar {
    display: none;
}

@media (max-width: 991.98px) {
    /* Toolbar: panel sayfalarında üstte sabit menü tetikleyici */
    .pn-dash-mobile-toolbar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 1040;
        margin: 0 -12px 14px;
        padding: 10px 14px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(148, 163, 184, 0.25);
        border-radius: 0 0 16px 16px;
        box-shadow: 0 8px 24px rgba(15, 39, 72, 0.06);
    }

    .pn-dash-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        min-height: 48px;
        padding: 0 16px;
        border: 1px solid rgba(17, 64, 127, 0.12);
        border-radius: 14px;
        background: linear-gradient(135deg, #11407f 0%, #2f80ed 100%);
        color: #fff !important;
        font-weight: 700;
        font-size: 0.95rem;
        cursor: pointer;
        box-shadow: 0 4px 14px rgba(17, 64, 127, 0.2);
    }

    .pn-dash-menu-btn:focus {
        outline: 2px solid rgba(47, 128, 237, 0.45);
        outline-offset: 2px;
    }

    .pn-dash-menu-icon {
        width: 22px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        position: relative;
        display: inline-block;
    }

    .pn-dash-menu-icon::before,
    .pn-dash-menu-icon::after {
        content: '';
        position: absolute;
        left: 0;
        width: 22px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
    }

    .pn-dash-menu-icon::before {
        top: -7px;
    }

    .pn-dash-menu-icon::after {
        top: 7px;
    }

    .pn-dash-mobile-toolbar-title {
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #64748b;
        margin: 0;
        flex: 1;
        min-width: 0;
    }

    /* Ana içerik önce, sidebar çekmece (.pn-dash-row JS ile eklenir) */
    .listpgWraper .pn-dash-row {
        display: flex;
        flex-direction: column;
    }

    .listpgWraper .pn-dash-main,
    .listpgWraper .company-dashboard-content,
    .listpgWraper .row > .col-md-9.col-sm-8:not(.pn-dash-sidebar-col) {
        order: 1;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto;
    }

    .listpgWraper .pn-dash-sidebar-col {
        order: 2;
        width: 100% !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        height: 100dvh;
        max-height: -webkit-fill-available;
        width: min(300px, 88vw) !important;
        margin: 0 !important;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 1060;
        overflow-x: hidden;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        transform: translate3d(-110%, 0, 0);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
        visibility: hidden;
        background: #f8fafc;
        border-right: 1px solid rgba(148, 163, 184, 0.35);
        box-shadow: 8px 0 32px rgba(15, 23, 42, 0.12);
    }

    body.pn-dash-drawer-open .listpgWraper .pn-dash-sidebar-col {
        transform: translate3d(0, 0, 0);
        visibility: visible;
    }

    /* Çekmece içi kapat (overlay dışında net kapatma) */
    .pn-dash-drawer-close-bar {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin: -8px -8px 10px;
        padding: 6px 4px 10px;
        position: sticky;
        top: 0;
        z-index: 3;
        background: linear-gradient(180deg, #f8fafc 85%, rgba(248, 250, 252, 0));
    }

    .pn-dash-drawer-close {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        padding: 8px 14px;
        border: 1px solid rgba(148, 163, 184, 0.45);
        border-radius: 12px;
        background: #fff;
        color: #0f172a;
        font-weight: 700;
        font-size: 0.9rem;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    }

    .pn-dash-drawer-close:focus {
        outline: 2px solid rgba(47, 128, 237, 0.45);
        outline-offset: 2px;
    }

    .pn-dash-drawer-close-icon {
        font-size: 1.35rem;
        line-height: 1;
        font-weight: 400;
        opacity: 0.85;
    }

    .pn-dash-drawer-close-text {
        letter-spacing: 0.02em;
    }

    .pn-dash-drawer-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1055;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(2px);
    }

    body.pn-dash-drawer-open .pn-dash-drawer-overlay {
        display: block;
    }

    body.pn-dash-drawer-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /*
     * main.css (≤767px) .usernavdash { display: none } — alt sayfa menüsü için;
     * yan panel çekmecesinde liste görünmüyordu. Çekmece içinde klasik liste göster.
     */
    .listpgWraper .pn-dash-sidebar-col .usernavdash,
    .listpgWraper .usernavwrap .usernavdash {
        display: block !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        z-index: auto !important;
        visibility: visible !important;
    }

    .listpgWraper .pn-dash-sidebar-col .usernavdash li,
    .listpgWraper .usernavwrap .usernavdash li {
        display: list-item !important;
    }

    /* Sekmeler: yatay kaydırma, taşma yok */
    .listpgWraper .nav-tabs,
    .listpgWraper .nav.nav-tabs,
    .usernavwrap + * .nav-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.35);
        padding-bottom: 2px;
        margin-bottom: 16px !important;
    }

    .listpgWraper .nav-tabs > li,
    .listpgWraper .nav.nav-tabs > li {
        float: none !important;
        flex: 0 0 auto;
        margin-bottom: 0 !important;
    }

    .listpgWraper .nav-tabs > li > a,
    .listpgWraper .nav.nav-tabs > li > a {
        white-space: nowrap;
        border-radius: 12px 12px 0 0 !important;
        padding: 12px 16px !important;
        min-height: 44px;
        display: inline-flex !important;
        align-items: center;
    }

    /* Tab içerikleri tam genişlik */
    .listpgWraper .tab-content {
        width: 100%;
        overflow-x: hidden;
    }

    /* Tablolar: yatay kaydırma */
    .listpgWraper .table-responsive,
    .listpgWraper table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .listpgWraper .userccount,
    .listpgWraper .formpanel {
        max-width: 100%;
        overflow-x: hidden;
    }
}

@media (min-width: 992px) {
    .pn-dash-mobile-toolbar,
    .pn-dash-drawer-overlay {
        display: none !important;
    }
}
