/**
 * Admin panel sidebar — plain CSS (no Vite/npm).
 * Light: darker stone panel vs pale main content. Dark: deeper rail vs body.
 */

/* Edit pages: one strip for “form + relation managers” (combined tabs) */
.fi-main .fi-sc-tabs:not(.fi-contained) {
    padding: 0.75rem 1rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(161, 161, 170, 0.45);
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

html.dark .fi-main .fi-sc-tabs:not(.fi-contained) {
    border-color: rgba(82, 82, 91, 0.65);
    background: rgba(9, 9, 11, 0.35);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* User view — profile header (Filament icons + avatar) */
.fi-infolist .dbl-user-profile-section {
    margin-bottom: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(24, 24, 27, 0.95) 100%);
    padding: 0.25rem 0.5rem;
}

html:not(.dark) .fi-infolist .dbl-user-profile-section {
    border-color: #e5e7eb;
    background: linear-gradient(135deg, #eff6ff 0%, #f9fafb 100%);
}

.fi-infolist .dbl-user-profile-section .fi-infolist-entry {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.fi-infolist .dbl-user-profile-section img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}

/* Avatar + name/email/phone: tight side-by-side (no wide 12-col gap) */
.fi-infolist .dbl-user-profile-section .dbl-user-profile-row {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    align-items: center !important;
    column-gap: 1.25rem !important;
    row-gap: 0.75rem !important;
}

.fi-infolist .dbl-user-profile-section .dbl-user-profile-row > .fi-grid-col,
.fi-infolist .dbl-user-profile-section .dbl-user-profile-row > [class*='grid-col'] {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
}

.fi-infolist .dbl-user-profile-section .dbl-user-profile-row > .fi-grid-col:first-child,
.fi-infolist .dbl-user-profile-section .dbl-user-profile-row > [class*='grid-col']:first-child {
    width: auto !important;
    flex: 0 0 auto;
}

.fi-infolist .dbl-user-profile-section .dbl-user-profile-row .fi-infolist-entry {
    padding-inline: 0;
}

@media (max-width: 639px) {
    .fi-infolist .dbl-user-profile-section .dbl-user-profile-row {
        grid-template-columns: 1fr !important;
        justify-items: center;
        text-align: center;
    }

    .fi-infolist .dbl-user-profile-section .dbl-user-profile-row .fi-infolist-entry {
        justify-content: center;
    }
}

/* Order edit — line items table in half column */
.fi-main .dbl-order-line-items-section .fi-section-content-ctn {
    max-width: none;
}

.fi-main .dbl-order-line-items-section .fi-ta-ctn {
    border-radius: 0.5rem;
}

/* Order edit — production section spans full form width */
.fi-main .dbl-order-production-section {
    grid-column: 1 / -1;
    width: 100%;
}

.fi-main .dbl-order-production-section .fi-section-content-ctn {
    max-width: none;
}

@media (min-width: 64rem) {
    /* Light theme: sidebar noticeably darker than main (typically gray-50) */
    html:not(.dark) .fi-sidebar.fi-sidebar-open {
        background-color: #e4e4e7;
        background-image: linear-gradient(
            165deg,
            #ececee 0%,
            #e0e0e5 40%,
            #d4d4da 100%
        );
        border-inline-end: 1px solid #a1a1aa;
        box-shadow:
            inset -1px 0 0 rgba(0, 0, 0, 0.06),
            8px 0 32px -16px rgba(0, 0, 0, 0.14),
            inset 0 1px 0 rgba(255, 255, 255, 0.35);
    }

    /* Dark theme: sidebar a shade darker / richer than main gray-950 body */
    html.dark .fi-sidebar.fi-sidebar-open {
        background-color: #09090b;
        background-image: linear-gradient(
            180deg,
            #0c0c0e 0%,
            #050506 55%,
            #020203 100%
        );
        border-inline-end: 1px solid rgba(82, 82, 91, 0.9);
        box-shadow:
            inset -1px 0 0 rgba(255, 255, 255, 0.04),
            10px 0 40px -18px rgba(0, 0, 0, 0.75);
    }
}
