/* ============================================================
   TRADEX ADMIN — ADMIN-BRAND-01 OFFICIAL BRANDING
   Visual-only branding layer. No business/auth/payment behavior.
============================================================ */

:root {
    --tradex-brand-gold: #d9a83c;
    --tradex-brand-gold-light: #f1cf73;
    --tradex-brand-blue: #213b58;
    --tradex-brand-shadow: rgba(217, 168, 60, .16);
}

.tradex-brand-image {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* ================================
   SIDEBAR BRAND
================================ */

.sidebar-brand {
    min-height: 104px;
    padding: 12px 18px;
    gap: 0;
    justify-content: flex-start;
    position: relative;
}

/*
 * Render the official full TradeX lockup in the sidebar instead of shrinking
 * it into a favicon-sized tile. The legacy text nodes stay in the Blade markup
 * for graceful fallback/accessibility, but are visually replaced by the local
 * official asset.
 */
.sidebar-brand > .brand-mark {
    display: block;
    flex: 0 0 184px;
    width: 184px;
    height: 80px;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-image: url('../brand/tradex-logo.webp');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: contain;
    box-shadow: none;
    color: transparent;
    font-size: 0;
    overflow: hidden;
}

.sidebar-brand > div:not(.brand-mark):not(.sidebar-brand-home) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sidebar-brand .brand-name {
    color: #f4f7fb;
}

.sidebar-brand .brand-subtitle {
    color: #6c8094;
}

.sidebar-brand-home {
    min-width: 0;
    height: 80px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-brand-logo {
    width: 184px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 9px 19px rgba(0, 0, 0, .28));
}

/* ================================
   TOPBAR BRAND
================================ */

.topbar-left::before,
.topbar-brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(217, 168, 60, .18);
    border-radius: 11px;
    background-color: rgba(8, 21, 35, .92);
    background-image: url('../brand/tradex-favicon.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 34px 34px;
    box-shadow: 0 9px 24px rgba(0, 0, 0, .22);
    overflow: hidden;
}

.topbar-left::before {
    content: "";
}

.topbar-brand-mark img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

/* ================================
   DASHBOARD / PAGE BRAND ACCENT
================================ */

.dashboard-brand-side {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-brand-lockup {
    width: 104px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border: 1px solid rgba(217, 168, 60, .12);
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(9, 25, 40, .82), rgba(4, 12, 21, .78));
    box-shadow: 0 13px 30px rgba(0, 0, 0, .16);
}

.dashboard-brand-lockup img {
    width: 88px;
    height: 64px;
    object-fit: contain;
}

/* ================================
   PAGE LOADER / SPLASH
================================ */

.tradex-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 44%, rgba(31, 68, 105, .24), transparent 34%),
        #03070d;
    opacity: 1;
    visibility: visible;
    transition: opacity .24s ease, visibility 0s linear 0s;
}

.tradex-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility 0s linear .24s;
}

.tradex-loader-card {
    display: grid;
    place-items: center;
    gap: 13px;
    min-width: 190px;
    padding: 22px 28px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 22px;
    background: rgba(6, 17, 30, .76);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
    backdrop-filter: blur(12px);
}

.tradex-loader-card img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    animation: tradex-brand-pulse 1.4s ease-in-out infinite;
}

.tradex-loader-card span {
    color: #71869b;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2.2px;
}

@keyframes tradex-brand-pulse {
    0%, 100% {
        transform: scale(.96);
        filter: drop-shadow(0 0 0 rgba(217, 168, 60, 0));
        opacity: .86;
    }

    50% {
        transform: scale(1.02);
        filter: drop-shadow(0 0 16px rgba(217, 168, 60, .22));
        opacity: 1;
    }
}

/* ================================
   AUTH BRAND HELPERS
================================ */

.auth-brand-logo {
    display: block;
    width: min(280px, 86%);
    height: auto;
    max-height: 240px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 16px 34px rgba(0, 0, 0, .28));
}

.auth-brand-mark {
    width: 74px;
    height: 74px;
    object-fit: contain;
}

/*
 * Login-specific visual fallback.
 * The semantic <img> remains in the Blade template for accessibility, but
 * these containers also paint the same local asset as a CSS background.
 * This makes the official logo resilient to browser image-layout/cache quirks
 * without introducing any external dependency.
 */
.brand-logo-wrap {
    background-image: url('../brand/tradex-logo.webp');
    background-repeat: no-repeat;
    background-position: left top;
    background-size: auto 230px;
}

.brand-logo-wrap > .auth-brand-logo {
    opacity: 0;
}

.login-mobile-brand {
    min-height: 150px;
    background-image: url('../brand/tradex-logo.webp');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: auto 150px;
}

.login-mobile-brand > img {
    opacity: 0;
}

/* ================================
   REPORT / PRINT BRAND HEADER
================================ */

.tradex-report-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.tradex-report-brand-logo {
    width: 132px;
    height: 90px;
    object-fit: contain;
}

.tradex-report-brand-meta {
    text-align: right;
}

.tradex-report-brand-meta strong,
.tradex-report-brand-meta span {
    display: block;
}

.tradex-report-brand-meta span {
    margin-top: 5px;
    color: #72869a;
    font-size: 11px;
}

@media (max-width: 820px) {
    .sidebar-brand {
        min-height: 92px;
        padding-block: 10px;
    }

    .sidebar-brand > .brand-mark {
        flex-basis: 164px;
        width: 164px;
        height: 70px;
    }

    .topbar-left::before,
    .topbar-brand-mark {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        background-size: 31px 31px;
    }

    .topbar-brand-mark img {
        width: 31px;
        height: 31px;
    }

    .dashboard-brand-side {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-brand-lockup {
        width: 92px;
        height: 64px;
    }

    .dashboard-brand-lockup img {
        width: 78px;
        height: 56px;
    }
}

@media (max-width: 560px) {
    .topbar-left::before,
    .topbar-brand-mark {
        display: none;
    }

    .tradex-report-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .tradex-report-brand-meta {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tradex-loader,
    .tradex-loader-card img {
        transition: none;
        animation: none;
    }
}

@media print {
    .tradex-report-brand {
        color: #111;
        border-bottom-color: #d8d8d8;
    }

    .tradex-report-brand-meta span {
        color: #555;
    }
}
