/**
 * Meerkat - shared sidebar stylesheet for the admin (/admin) and customer (/account) panels.
 * Customizations for sidebar separation, header alignment, compact typography, and the version indicator.
 */

/* ==========================================================================
   1. Header Height Alignment (Sidebar Header & Topbar Nav)
   ========================================================================== */

/* Both sidebar header and topbar must have identical 64px (4rem) height and matching border */
.fi-sidebar-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    height: 4rem !important;
    min-height: 4rem !important;
    max-height: 4rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.fi-topbar > nav {
    height: 4rem !important;
    min-height: 4rem !important;
    max-height: 4rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-sizing: border-box !important;
}

.dark .fi-sidebar-header {
    background-color: #0b1120 !important;
    border-bottom: 1px solid #1e293b !important;
}

.dark .fi-topbar > nav {
    border-bottom: 1px solid #1e293b !important;
}

/* ==========================================================================
   2. Sidebar Separation & Background
   ========================================================================== */

/* Distinct sidebar background and subtle right border to separate from main page content */
.fi-sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 1px 0 3px 0 rgba(0, 0, 0, 0.02) !important;
}

.dark .fi-sidebar {
    background-color: #0b1120 !important;
    border-right: 1px solid #1e293b !important;
    box-shadow: 1px 0 6px 0 rgba(0, 0, 0, 0.35) !important;
}

/* Sidebar navigation container with compact padding */
.fi-sidebar-nav {
    background-color: transparent !important;
    padding: 1rem 0.625rem !important;
}

/* ==========================================================================
   3. Compact Sidebar Navigation Groups
   ========================================================================== */

/* Tighter vertical spacing between groups */
.fi-sidebar-nav-groups {
    row-gap: 1.125rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Group collapse/header button */
.fi-sidebar-group-button {
    padding: 0.25rem 0.5rem !important;
}

/* Group title: subtle badge look (no uppercase, see capitalization rules) */
.fi-sidebar-group-label {
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    line-height: 1rem !important;
}

.dark .fi-sidebar-group-label {
    color: #94a3b8 !important;
}

/* Tighter gap between items in the same group */
.fi-sidebar-group-items {
    row-gap: 0.1875rem !important;
}

/* ==========================================================================
   4. Compact Sidebar Items & Icons
   ========================================================================== */

/* Navigation item button: compact padding and refined border radius */
.fi-sidebar-item-button {
    padding: 0.375rem 0.625rem !important;
    border-radius: 0.375rem !important;
    gap: 0.625rem !important;
    min-height: 2.125rem !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

/* Navigation item icon: reduced from 24px (1.5rem) to 18px (1.125rem) */
.fi-sidebar-item-icon {
    width: 1.125rem !important;
    height: 1.125rem !important;
    flex-shrink: 0 !important;
}

/* Navigation item label: reduced from 14px to 13px (0.8125rem) */
.fi-sidebar-item-label {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    line-height: 1.25rem !important;
}

/* Sub-item border indicator when no icon */
.fi-sidebar-item-grouped-border {
    width: 1.125rem !important;
    height: 1.125rem !important;
}

/* Active navigation item */
.fi-sidebar-item.fi-active > .fi-sidebar-item-button {
    background-color: #eef2ff !important;
    color: #4338ca !important;
    font-weight: 600 !important;
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-button {
    background-color: rgba(99, 102, 241, 0.16) !important;
    color: #a5b4fc !important;
    font-weight: 600 !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #4f46e5 !important;
}

.dark .fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #818cf8 !important;
}

/* Hover state for non-active items */
.fi-sidebar-item-button:hover:not(.fi-active) {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.dark .fi-sidebar-item-button:hover:not(.fi-active) {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #f8fafc !important;
}

/* Badges inside sidebar items */
.fi-sidebar-item .fi-badge {
    font-size: 0.6875rem !important;
    padding: 0.125rem 0.375rem !important;
}

/* ==========================================================================
   5. Version Indicator (sidebar footer)
   ========================================================================== */

.mk-version {
    border-top: 1px solid #e2e8f0;
    padding: 0.625rem 1.25rem;
    font-size: 0.6875rem;
    line-height: 1rem;
    text-align: center;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dark .mk-version {
    border-top-color: #1e293b;
    color: #64748b;
}
