/* FinNexus Global Design System */
:root {
    --color-brand-50: #f0fdfa;
    --color-brand-100: #ccfbf1;
    --color-brand-200: #99f6e4;
    --color-brand-500: #14b8a6;
    --color-brand-600: #0d9488;
    --color-brand-700: #0f766e;

    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;

    --color-emerald-50: #ecfdf5;
    --color-emerald-100: #d1fae5;
    --color-emerald-600: #059669;

    --color-amber-50: #fffbeb;
    --color-amber-100: #fef3c7;
    --color-amber-600: #d97706;

    --color-red-50: #fef2f2;
    --color-red-100: #fee2e2;
    --color-red-600: #dc2626;
}

body {
    background-color: var(--color-slate-50);
    font-family: 'Inter', sans-serif;
    color: var(--color-slate-800);
}

/* Typography */
.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

/* Colors */
.text-slate-400 {
    color: var(--color-slate-400) !important;
}

.text-slate-500 {
    color: var(--color-slate-500) !important;
}

.text-slate-600 {
    color: var(--color-slate-600) !important;
}

.text-slate-800 {
    color: var(--color-slate-800) !important;
}

.text-brand-600 {
    color: var(--color-brand-600) !important;
}

.text-emerald-600 {
    color: var(--color-emerald-600) !important;
}

.bg-slate-50 {
    background-color: var(--color-slate-50) !important;
}

.bg-slate-100 {
    background-color: var(--color-slate-100) !important;
}

.bg-slate-900 {
    background-color: var(--color-slate-900) !important;
}

.bg-brand-600 {
    background-color: var(--color-brand-600) !important;
}

.bg-white {
    background-color: #ffffff !important;
}

/* Components */
.rounded-xl {
    border-radius: 0.75rem !important;
}

.rounded-2xl {
    border-radius: 1rem !important;
}

.rounded-lg {
    border-radius: 0.5rem !important;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1) !important;
}

.border {
    border-width: 1px !important;
}

.border-slate-200 {
    border-color: var(--color-slate-200) !important;
}

/* Animations */
.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Layout & Structure */
#wrapper {
    height: 100%;
    overflow: hidden;
    width: 100%;
}

.content-page {
    margin-left: 260px;
    overflow: hidden;
    padding-top: 70px;
    /* Topbar Height */
    min-height: 100vh;
    background-color: var(--color-slate-50);
}

.left-side-menu {
    width: 260px;
    z-index: 1000;
    background: var(--color-slate-900);
    bottom: 0;
    position: fixed;
    top: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.navbar-custom {
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    left: 260px;
    right: 0;
    top: 0;
    height: 70px;
    position: fixed;
    z-index: 999;
    transition: all 0.2s;
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .content-page {
        margin-left: 0 !important;
    }

    .navbar-custom {
        left: 0 !important;
    }

    .left-side-menu {
        display: none;
        /* Default hidden on mobile, toggled via JS usually */
        /* If using a toggled class, we handle that separately */
    }

    /* When sidebar is active on mobile */
    .sidebar-enable .left-side-menu {
        display: block;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 10001;
    }
}

/* Sidebar Overrides & cleanup */
.left-side-menu {
    background-color: var(--color-slate-900) !important;
}

.logo-box {
    background-color: var(--color-slate-900) !important;
    min-height: 90px;
    /* Increased height */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Ensure left alignment */
    padding: 20px 24px;
    /* Added vertical padding */
    position: relative !important;
    width: 100% !important;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
}

.logo-box a {
    display: flex;
    align-items: center;
    text-decoration: none;
    width: 100%;
}

#side-menu {
    padding: 0 12px 20px 12px;
    margin-top: 0 !important;
}

#side-menu>li>a {
    color: var(--color-slate-400) !important;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    position: relative;
    text-decoration: none;
    border: none !important;
}

/* Hover State */
#side-menu>li>a:hover {
    background-color: var(--color-slate-800) !important;
    color: #ffffff !important;
}

/* Active State */
#side-menu>li>a.active {
    background-color: var(--color-brand-600) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.5) !important;
}

/* Fix for potential pseudo-element glitches from base theme */
#side-menu>li>a::before,
#side-menu>li>a::after {
    display: none !important;
    content: none !important;
}

#side-menu>li>a i,
#side-menu>li>a svg {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    color: inherit;
    font-size: 20px;
    /* Ensure icon size */
}

.menu-title {
    color: var(--color-slate-500) !important;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 24px 16px 8px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--color-slate-800);
    background-color: var(--color-slate-900);
}

/* Sidebar Toggle States (Added for functionality) */

/* Desktop Collapsed State */
@media (min-width: 992px) {
    body[data-sidebar="hidden"] .left-side-menu {
        width: 70px !important;
    }

    body[data-sidebar="hidden"] .content-page {
        margin-left: 70px !important;
    }

    body[data-sidebar="hidden"] .navbar-custom {
        left: 70px !important;
    }

    body[data-sidebar="hidden"] .logo-box {
        width: 70px !important;
        padding: 0 !important;
        justify-content: center !important;
    }

    body[data-sidebar="hidden"] .logo-box .ms-3 {
        display: none !important;
        /* Hide text container */
    }

    body[data-sidebar="hidden"] #side-menu span {
        display: none !important;
        /* Hide link text */
    }

    body[data-sidebar="hidden"] .menu-title {
        display: none !important;
    }

    body[data-sidebar="hidden"] #side-menu>li>a {
        justify-content: center !important;
        padding: 12px 0 !important;
    }

    body[data-sidebar="hidden"] #side-menu>li>a i,
    body[data-sidebar="hidden"] #side-menu>li>a svg {
        margin-right: 0 !important;
    }

    /* Hover to expand (optional, usually preferred in admin panels) */
    body[data-sidebar="hidden"] .left-side-menu:hover {
        width: 260px !important;
    }

    body[data-sidebar="hidden"] .left-side-menu:hover .logo-box {
        width: 100% !important;
        padding-left: 24px !important;
        justify-content: flex-start !important;
    }

    body[data-sidebar="hidden"] .left-side-menu:hover .logo-box .ms-3 {
        display: block !important;
    }

    body[data-sidebar="hidden"] .left-side-menu:hover #side-menu span {
        display: inline !important;
    }

    body[data-sidebar="hidden"] .left-side-menu:hover .menu-title {
        display: block !important;
    }

    body[data-sidebar="hidden"] .left-side-menu:hover #side-menu>li>a {
        justify-content: flex-start !important;
        padding: 12px 16px !important;
    }

    body[data-sidebar="hidden"] .left-side-menu:hover #side-menu>li>a i {
        margin-right: 12px !important;
    }
}

/* Mobile Toggle State */
@media (max-width: 991.98px) {

    /* Hidden by default on mobile via media query above, but let's reinforce logic */
    .left-side-menu {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        display: block !important;
        /* Always block, just moved off canvass */
    }

    body[data-sidebar="default"] .left-side-menu {
        transform: translateX(0);
        /* Slide In */
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 10001;
        width: 260px !important;
    }

    /* Overlay when menu is open */
    body[data-sidebar="default"]::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
    }
}