/* ═══════════════════════════════════════════════════════════════════════════
   Webroster Admin — Custom Navbar / Sidebar Theme
   Overrides Filament 3 defaults to match brand palette.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────────────────────── */
:root {
    --wr-navy:        #0d2057;
    --wr-blue:        #1B3888;
    --wr-blue-mid:    #2a4fa8;
    --wr-blue-light:  #3d67c4;
    --wr-green:       #1A8A3C;
    --wr-green-light: #22a84a;
    --wr-text:        rgba(255, 255, 255, 0.90);
    --wr-text-muted:  rgba(255, 255, 255, 0.50);
    --wr-divider:     rgba(255, 255, 255, 0.10);
    --wr-hover:       rgba(255, 255, 255, 0.08);
    --wr-active:      rgba(255, 255, 255, 0.14);
}

/* ─── Sidebar shell ─────────────────────────────────────────────────────── */
.fi-sidebar {
    background: linear-gradient(180deg, var(--wr-navy) 0%, var(--wr-blue) 100%) !important;
    border-right: none !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18) !important;
}

/* Sidebar header (logo bar) */
.fi-sidebar-header {
    background: transparent !important;
    border-bottom: 1px solid var(--wr-divider) !important;
    ring: none !important;
    box-shadow: none !important;
}

/* Remove the default ring on the header */
.fi-sidebar-header {
    --tw-ring-shadow: none !important;
    box-shadow: none !important;
}

/* ─── Sidebar brand logo ────────────────────────────────────────────────── */
/* The logo SVG already has a blue rounded-square background + white arc +
   green checkmark — no filter needed; display it at a fixed size.          */
.fi-sidebar-header .fi-logo {
    display: flex !important;
    align-items: center !important;
}

.fi-logo img {
    height: 2.2rem !important;
    width: auto !important;
    display: block !important;
}

/* ─── Sidebar nav ───────────────────────────────────────────────────────── */
.fi-sidebar-nav {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* Nav group labels */
.fi-sidebar-group-label {
    color: var(--wr-text-muted) !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}

/* Nav items */
.fi-sidebar-item-button {
    border-radius: 8px !important;
    color: var(--wr-text) !important;
    transition: background 0.15s, color 0.15s !important;
}

.fi-sidebar-item-button:hover {
    background: var(--wr-hover) !important;
    color: #fff !important;
}

/* Active nav item */
.fi-sidebar-item-button.fi-active,
.fi-sidebar-item-button[aria-current="page"],
.fi-sidebar-item-active .fi-sidebar-item-button {
    background: var(--wr-active) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--wr-green) !important;
    border-radius: 0 8px 8px 0 !important;
    margin-left: -1.5rem !important;
    padding-left: calc(1.5rem + 0.75rem) !important;
}

/* Nav item icons */
.fi-sidebar-item-button .fi-sidebar-item-icon {
    color: var(--wr-text) !important;
    opacity: 0.85;
}

.fi-sidebar-item-button.fi-active .fi-sidebar-item-icon,
.fi-sidebar-item-active .fi-sidebar-item-button .fi-sidebar-item-icon {
    color: #fff !important;
    opacity: 1;
}

/* Nav item labels */
.fi-sidebar-item-label {
    color: inherit !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

/* Sidebar group collapse button */
.fi-sidebar-group-collapse-button {
    color: var(--wr-text-muted) !important;
}

.fi-sidebar-group-collapse-button:hover {
    color: var(--wr-text) !important;
    background: var(--wr-hover) !important;
}

/* ─── Sidebar footer ────────────────────────────────────────────────────── */
.fi-sidebar-footer {
    border-top: 1px solid var(--wr-divider) !important;
    background: transparent !important;
    padding: 0.75rem 1.5rem !important;
}

/* ─── Topbar ────────────────────────────────────────────────────────────── */
.fi-topbar nav {
    background: #ffffff !important;
    border-bottom: 1px solid #E2E8F0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
    --tw-ring-shadow: none !important;
}

/* Topbar hamburger / close button */
.fi-topbar-open-sidebar-btn,
.fi-topbar-close-sidebar-btn {
    color: var(--wr-blue) !important;
}

/* Topbar icon buttons (global search, notifications, user menu trigger) */
.fi-topbar nav .fi-icon-btn {
    color: #64748B !important;
}

.fi-topbar nav .fi-icon-btn:hover {
    background: #F1F5F9 !important;
    color: var(--wr-blue) !important;
}

/* Mobile topbar brand */
.wr-mobile-topbar-brand {
    display: none;
}

@media (max-width: 1023px) {
    .fi-topbar nav {
        position: relative !important;
    }

    .wr-mobile-topbar-brand {
        display: block;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        max-width: min(12rem, calc(100vw - 11rem));
        color: var(--wr-blue);
        font-size: 1rem;
        font-weight: 800;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        pointer-events: none;
    }
}

.dark .wr-mobile-topbar-brand {
    color: #ffffff;
}

/* ─── User menu ─────────────────────────────────────────────────────────── */
.fi-user-menu-item {
    border-radius: 6px !important;
}

.fi-user-menu-item:hover {
    background: #F1F5F9 !important;
}

/* ─── Sidebar scrollbar ─────────────────────────────────────────────────── */
.fi-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.fi-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.fi-sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--wr-divider);
    border-radius: 4px;
}

/* ─── Dark mode: keep sidebar dark regardless of OS preference ───────────── */
.dark .fi-sidebar {
    background: linear-gradient(180deg, #080f2a 0%, #0d2057 100%) !important;
}
.dark .fi-topbar nav {
    background: #0f172a !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

/* ─── Simulation banner position fix ────────────────────────────────────── */
.wr-simulation-banner {
    z-index: 40 !important;
}

/* ─── Brand name text (rendered next to the logo by Filament) ───────────── */
.fi-logo-text,
.fi-brand-name {
    color: #ffffff !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
}
