/* Medcare-Inspired Professional Fintech Styles */

:root {
    --filament-primary: #0d9488;
    --sidebar-bg: #134e4a;
    --app-bg: #f8fafc;
}

.dark {
    --app-bg: #0f172a;
    --sidebar-bg: #134e4a;
}

/* Overall Layout Background - Fix black area at bottom */
html, body, .fi-layout {
    background-color: var(--app-bg) !important;
}

/* Sidebar & Layout Configuration */
:root {
    --sidebar-width: 18rem;
    --sidebar-collapsed-width: 5rem;
    --sidebar-gutter: 2.5rem; /* Increased spacing for proper rounding view */
}

/* Base Topbar Styling - Dynamic padding based on sidebar state */
@media (min-width: 1024px) {
    .fi-topbar {
        background-color: var(--app-bg) !important;
        box-shadow: none !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding-left: var(--sidebar-width) !important;
        z-index: 30 !important;
        transition: padding-left 0.3s ease !important;
    }
    
    .fi-sidebar[aria-expanded="false"] ~ .fi-topbar {
        padding-left: var(--sidebar-collapsed-width) !important;
    }
    
    .fi-topbar > nav {
        background-color: transparent !important;
    }
    
    .fi-main {
        padding-top: 4.5rem !important;
        padding-left: var(--sidebar-gutter) !important;
        padding-right: 1.5rem !important; /* Proper right padding for breathing room */
        width: calc(100% - var(--sidebar-width)) !important;
        max-width: none !important; /* Ensure it's not restricted */
        margin-left: var(--sidebar-width) !important;
        transition: all 0.3s ease !important;
    }

    .fi-sidebar[aria-expanded="false"] ~ .fi-main {
        margin-left: var(--sidebar-collapsed-width) !important;
        width: calc(100% - var(--sidebar-collapsed-width)) !important;
    }
}

/* Sidebar Container - Unified styling for both states */
.fi-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    z-index: 50 !important;
    background-color: var(--sidebar-bg) !important;
    border-right: none !important;
    border-top-right-radius: 2rem !important;
    border-bottom-right-radius: 2rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    transition: width 0.3s ease, transform 0.3s ease !important;
    overflow: visible !important; /* Allow toggle to breathe if needed */
}

/* Hide brand from topbar header */
.fi-topbar .fi-logo, 
.fi-topbar-header .fi-logo {
    display: none !important;
}

/* Sidebar Components Integration */
.fi-sidebar-header,
.fi-sidebar-nav {
    background-color: transparent !important;
    width: 100% !important;
}

.fi-sidebar-header {
    padding: 2rem 1.25rem 1.5rem 1.5rem !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 5rem;
}

.fi-sidebar-header .fi-logo {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    color: white !important;
    text-decoration: none !important;
    transition: opacity 0.2s ease;
}

.fi-sidebar-header .fi-logo img {
    height: 4.5rem !important;
    max-height: 4.5rem !important;
}

/* Hide logo image when collapsed */
.fi-sidebar[aria-expanded="false"] .fi-logo {
    opacity: 0 !important;
    pointer-events: none;
    display: none !important;
}

.fi-sidebar-nav {
    flex: 1 !important;
    overflow-y: auto !important;
    padding-bottom: 2rem !important;
}

/* Sidebar Toggle Icon Styling - Floating on the right */
.fi-sidebar-collapse-button {
    display: flex !important;
    color: white !important;
    opacity: 1 !important;
    z-index: 60 !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-radius: 0.75rem !important;
    padding: 0.4rem !important;
    transition: all 0.2s ease;
}

.fi-sidebar-collapse-button:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    transform: scale(1.05);
}

/* Navigation Items Styling */
/* Sidebar Navigation Items Styling */
.fi-sidebar-item-btn {
    border-radius: 0.75rem !important;
    margin: 0.25rem 1rem !important;
    color: white !important;
    opacity: 0.8 !important;
    transition: all 0.2s ease !important;
    background-color: transparent !important;
}

.fi-sidebar-item-btn :is(.fi-sidebar-item-label, .fi-sidebar-item-icon, span, svg, div) {
    color: inherit !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

.fi-sidebar-item-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    opacity: 1 !important;
}

.fi-active > .fi-sidebar-item-btn {
    background-color: white !important;
    color: #134e4a !important; /* Match sidebar background for contrast */
    font-weight: 700 !important;
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.fi-active > .fi-sidebar-item-btn :is(.fi-sidebar-item-label, .fi-sidebar-item-icon, span, svg, div) {
    color: #134e4a !important; /* Force green/dark color inside white button */
    fill: #134e4a !important;
    stroke: #134e4a !important;
}

.fi-sidebar-group-btn {
    color: rgba(255, 255, 255, 0.7) !important;
}

.fi-sidebar-group-btn .fi-sidebar-group-label {
    color: inherit !important;
}


/* High-Rounding for Cards and Components */
.fi-section, 
.fi-ta-ctn, 
.fi-wi-stats-overview-stat {
    border-radius: 1.5rem !important;
    border: none !important;
    background-color: white !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

/* Only add border in Light Mode */
:not(.dark) .fi-section, 
:not(.dark) .fi-ta-ctn, 
:not(.dark) .fi-wi-stats-overview-stat {
    border: 1px solid #e2e8f0 !important;
}

.dark .fi-section, 
.dark .fi-ta-ctn, 
.dark .fi-wi-stats-overview-stat {
    background-color: #1e293b !important;
    color: white !important;
    border: none !important;
}

/* Topbar Refinement */
.fi-topbar {
    background-color: white !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.dark .fi-topbar {
    background-color: #1e293b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Text Readability Fixes */
.fi-header-heading {
    color: #1e293b !important;
    font-weight: 800 !important;
}

.dark .fi-header-heading {
    color: white !important;
}

/* Multi-line User Menu Label */
.fi-user-menu-trigger-text,
.fi-dropdown-header > div > span,
.fi-dropdown-header-label {
    white-space: pre-line !important;
    line-height: 1.2 !important;
    text-align: left !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
}

/* ==========================================================
   Welcome Banner Custom Classes (Bypassing missing Tailwind) 
========================================================== */
.wb-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .wb-container {
        flex-direction: row;
        align-items: center;
    }
}

.wb-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

.dark .wb-title {
    color: white;
}

.wb-subtitle {
    color: #64748b;
    font-weight: 500;
    margin-top: 0.25rem;
}

.dark .wb-subtitle {
    color: #94a3b8;
}

.wb-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #f1f5f9;
}

.dark .wb-card {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

.wb-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background-color: #f0fdf4;
    color: #0d9488;
}

.dark .wb-icon-box {
    background-color: rgba(13, 148, 136, 0.2);
    color: #2dd4bf;
}

.wb-icon-box svg,
.wb-icon-box x-heroicon-o-calendar,
.wb-icon-box [class*="heroicon"] {
    width: 1.5rem !important;
    height: 1.5rem !important;
    margin: auto;
}

.wb-date-col {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.wb-day {
    font-size: 0.65rem;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wb-date {
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
}

.dark .wb-date {
    color: #cbd5e1;
}

.wb-divider {
    width: 1px;
    height: 2rem;
    background-color: #e2e8f0;
    margin: 0 0.25rem;
}

.dark .wb-divider {
    background-color: #334155;
}

.wb-time {
    font-size: 1.25rem;
    font-weight: 900;
    color: #0d9488;
    font-variant-numeric: tabular-nums;
}

.dark .wb-time {
    color: #2dd4bf;
}
