/* Masaüstü admin: dar ikon şeridi + grup paneli */
.admin-chrome {
    display: flex;
    flex-shrink: 0;
    align-items: stretch;
    min-height: calc(100vh - var(--header-h, 64px));
    z-index: 20;
}

.admin-rail {
    width: 72px;
    flex-shrink: 0;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.7rem 0.35rem;
    position: sticky;
    top: var(--header-h, 64px);
    height: calc(100vh - var(--header-h, 64px));
    overflow-y: auto;
    overflow-x: hidden;
}

.admin-rail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.15rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.admin-rail-btn span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
    text-align: center;
}

.admin-rail-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    flex-shrink: 0;
}

.admin-rail-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.admin-rail-btn.is-on {
    color: #fff;
    background: rgba(74, 110, 52, 0.38);
    box-shadow: inset 3px 0 0 #4A6E34;
}

.admin-rail-dot {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 1px solid #0f172a;
}

.admin-flyout {
    width: 248px;
    flex-shrink: 0;
    background: var(--surface-solid, #fff);
    border-right: 1px solid var(--border, #e2e8f0);
    padding: 1rem 0.7rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    position: sticky;
    top: var(--header-h, 64px);
    height: calc(100vh - var(--header-h, 64px));
    overflow-y: auto;
}

.admin-flyout-title {
    margin: 0 0 0.55rem;
    padding: 0 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.admin-flyout .admin-nav-item {
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-size: 0.84rem;
}

.admin-flyout .admin-nav-item.active,
.admin-flyout .admin-nav-item.active:hover,
.admin-shell .admin-flyout .admin-nav-item.active,
.admin-shell .admin-flyout .admin-nav-item.active:hover {
    background: color-mix(in srgb, var(--primary, #4A6E34) 12%, var(--surface-solid, #fff)) !important;
    color: var(--primary, #4A6E34) !important;
    box-shadow: inset 3px 0 0 var(--primary, #4A6E34) !important;
    text-decoration: none;
}

.admin-flyout .admin-nav-item.active svg {
    stroke: var(--primary, #4A6E34);
}

[data-theme="dark"] .admin-flyout {
    background: var(--surface-solid, #0f172a);
    border-right-color: var(--border, #334155);
}

.admin-shell.sidebar-hidden .admin-chrome {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    border: none !important;
}

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

    .admin-chrome {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        min-height: 0;
        z-index: 3000;
        background: #0f172a;
        transform: translateX(-110%);
        transition: transform 0.28s ease;
        padding-top: calc(52px + env(safe-area-inset-top, 0px));
        pointer-events: none;
        width: min(320px, 92vw) !important;
        max-width: 92vw;
        overflow: hidden !important;
        box-shadow: 8px 0 28px rgba(15, 23, 42, 0.28);
    }

    .admin-shell.mobile-menu-open .admin-chrome {
        transform: translateX(0);
        pointer-events: auto;
    }

    .admin-shell.sidebar-hidden .admin-chrome {
        width: min(320px, 92vw) !important;
        overflow: hidden !important;
    }

    .admin-rail {
        position: relative;
        top: 0;
        width: 72px;
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .admin-rail-btn {
        font-size: 0.55rem;
    }

    .admin-flyout {
        position: relative;
        top: 0;
        flex: 1;
        min-width: 0;
        width: auto;
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        padding-top: 1rem;
    }
}
