:root {
    --text-sm: 0.8rem !important;
}
/* ========================================
   Main Sidebar Container
   ======================================== */
aside.fi-sidebar.fi-main-sidebar {
    background-color: #ffffff !important;
    border-inline-end: 1px solid #e5e7eb !important;
    width: 17.5rem !important;
    position: fixed !important;
    inset-block: 0 !important;
    inset-inline-start: 0 !important;
    z-index: 39 !important;
    transition: transform 240ms ease !important;
}

/* LTR: slide out to the left */
[dir="ltr"] aside.fi-sidebar.fi-main-sidebar {
    transform: translateX(-100%) !important;
}

/* RTL: slide out to the right */
[dir="rtl"] aside.fi-sidebar.fi-main-sidebar {
    transform: translateX(100%) !important;
}

:root {
    --pharmacy-sidebar-width: 17.5rem;
}

aside.fi-sidebar.fi-main-sidebar.fi-sidebar-open {
    transform: translateX(0) !important;
}

/* Shift content when sidebar is open (desktop) */
.fi-main-ctn {
    transition: margin-inline-start 240ms ease !important;
    margin-inline-start: 0 !important;
    width: 100% !important;
}

.fi-main-ctn.fi-main-ctn-sidebar-open {
    margin-inline-start: var(--pharmacy-sidebar-width) !important;
}

/* On mobile, let sidebar overlay instead of shifting content */
@media (max-width: 1023px) {
    .fi-main-ctn.fi-main-ctn-sidebar-open {
        margin-inline-start: 0 !important;
    }
}

/* Topbar burger toggle button */
.pharmacy-topbar-sidebar-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    border: 0.0625rem solid #ddd !important;
    border-radius: 0.375rem !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    cursor: pointer !important;
}

.pharmacy-topbar-sidebar-toggle:hover {
    background-color: #e4f1ef !important;
    color: #239ea0 !important;
}

.pharmacy-topbar-sidebar-toggle-icon {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

/* Page title inside topbar (next to burger) */
.pharmacy-topbar-page-title {
    margin-inline-start: 0.75rem !important;
    font-size: 1.2rem !important;
    font-weight: 500 !important;
    color: #111827 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

[dir='rtl'] .pharmacy-topbar-page-title {
    margin-inline-start: 0.75rem !important;
}

/* Reduce topbar text sizes on small screens by 20% */
@media (max-width: 768px) {
    .pharmacy-topbar-page-title {
        font-size: 0.96rem !important;
    }

    .pharmacy-topbar-sidebar-toggle {
        width: 2rem !important;
        height: 2rem !important;
    }

    .pharmacy-topbar-sidebar-toggle-icon {
        width: 1rem !important;
        height: 1rem !important;
    }
}
/* ========================================
   Logo Section (sidebar-only)
   ======================================== */
.fi-sidebar .fi-sidebar-header-ctn {
    background-color: #ffffff !important;
}

.fi-sidebar .fi-sidebar-header {
    padding: 1.75rem 1rem 1.25rem !important;
    margin: 1.5rem 0 !important;
    background-color: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.fi-sidebar .fi-sidebar-header-logo-ctn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
}

.fi-sidebar .fi-sidebar-header-logo-ctn > a {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    text-decoration: none !important;
}

.fi-sidebar .pharmacy-sidebar-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.25rem 0 0.5rem !important;
}

.fi-sidebar .pharmacy-sidebar-brand-logo {
    max-width: 144px !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}

.fi-sidebar .pharmacy-sidebar-brand-subtitle {
    font-size: 0.8125rem !important;
    color: #6b7280 !important;
    font-weight: 400 !important;
    display: block !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
}

/* ========================================
   Facility Branding (hospital panel)
   ======================================== */
.fi-sidebar .pharmacy-sidebar-facility {
    display: flex !important;
    align-items: center !important;
    gap: 0.625rem !important;
    padding: 0.25rem 0 !important;
    text-decoration: none !important;
}

.fi-sidebar .pharmacy-sidebar-facility-logo {
    width: 2.5rem !important;
    height: 2.5rem !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 0.5rem !important;
    border: 1px solid #bfe3e7 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.fi-sidebar .pharmacy-sidebar-facility-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.fi-sidebar .pharmacy-sidebar-facility-text {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    min-width: 0 !important;
    text-align: left !important;
}

.fi-sidebar .pharmacy-sidebar-facility-name {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.fi-sidebar .pharmacy-sidebar-facility-id {
    font-size: 0.6875rem !important;
    color: #6b7280 !important;
    font-weight: 400 !important;
    text-align: left !important;
    margin-top: 0.125rem !important;
}

/* ========================================
   Navigation Container
   ======================================== */
.fi-sidebar .fi-sidebar-nav {
    padding: 0.5rem !important;
    background-color: #ffffff !important;
}

.fi-sidebar .fi-sidebar-nav-groups {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.fi-sidebar .fi-sidebar-nav-groups > li {
    width: 100% !important;
}

/* ========================================
   Navigation Groups (collapsible sections)
   ======================================== */
.fi-sidebar .fi-sidebar-group {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
}

/* Group header button - card style */
.fi-sidebar .fi-sidebar-group-btn {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0.5625rem 0.75rem 0.5rem 0.75rem !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    color: #000000 !important;
    background-color: #ffffff !important;
    text-decoration: none !important;
    border: 0.0625rem solid #ddd !important;
    border-radius: 0.375rem !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.fi-sidebar .fi-sidebar-group-btn:hover {
    background-color: #e4f1ef !important;
    border-color: #ddd !important;
    color: #239ea0 !important;
}

.fi-sidebar .fi-sidebar-group-btn:hover .fi-sidebar-group-label,
.fi-sidebar .fi-sidebar-group-btn:hover .fi-sidebar-group-collapse-btn {
    color: #239ea0 !important;
}

/* Hide group icons */
.fi-sidebar .fi-sidebar-group-btn > svg:first-child {
    display: none !important;
}

/* Group label */
.fi-sidebar .fi-sidebar-group-label {
    flex: 1 !important;
    text-align: left !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    color: #000000 !important;
}

/* Collapse/expand arrow */
.fi-sidebar .fi-sidebar-group-collapse-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #9ca3af !important;
    padding: 0 !important;
    margin-left: auto !important;
}

.fi-sidebar .fi-sidebar-group-collapse-btn svg {
    width: 1rem !important;
    height: 1rem !important;
}

/* Active group styling - light teal background */
.fi-sidebar .fi-sidebar-group.fi-active > .fi-sidebar-group-btn {
    background-color: #e4f1ef !important;
    border-color: #ddd !important;
    color: #239ea0 !important;
}

.fi-sidebar .fi-sidebar-group.fi-active .fi-sidebar-group-label {
    color: #239ea0 !important;
}

.fi-sidebar .fi-sidebar-group.fi-active .fi-sidebar-group-collapse-btn {
    color: #239ea0 !important;
}

/* ========================================
   Group Items (sub-navigation)
   ======================================== */
.fi-sidebar .fi-sidebar-group-items {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    background-color: transparent !important;
    border-radius: 0 !important;
}

/* Gray background only for groups that have a label (collapsible groups) */
.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) > .fi-sidebar-group-items {
    padding: 0.5rem !important;
    margin: 0.125rem 0 0 0 !important;
    background-color: #f3f4f6 !important;
    border-radius: 0.375rem !important;
}

/* ========================================
   Navigation Items
   ======================================== */
.fi-sidebar .fi-sidebar-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Item link/button - card style */
.fi-sidebar .fi-sidebar-item-btn {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0.5625rem 0.75rem 0.5rem 0.75rem !important;
    font-size: 0.8125rem !important;
    font-weight: 900 !important;
    color: #374151 !important;
    background-color: #ffffff !important;
    text-decoration: none !important;
    border: 0.0625rem solid #ddd !important;
    border-radius: 0.375rem !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.fi-sidebar .fi-sidebar-item-btn:hover {
    background-color: #e4f1ef !important;
    border-color: #ddd !important;
    color: #239ea0 !important;
}

.fi-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-badge-ctn {
    color: #239ea0 !important;
}

/* Hide navigation item icons */
.fi-sidebar .fi-sidebar-item-icon {
    display: none !important;
}

/* Item label */
.fi-sidebar .fi-sidebar-item-label {
    flex: 1 !important;
    text-align: left !important;
    color: #000000 !important;
    font-weight: 700 !important;
    font-size: 0.8125rem !important;
}

/* Hide grouped border decorations */
.fi-sidebar .fi-sidebar-item-grouped-border {
    display: none !important;
}

/* Active item styling - light teal background like reference */
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background-color: #e4f1ef !important;
    border-color: #ddd !important;
    color: #239ea0 !important;
    font-weight: 900 !important;
}

.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-btn .fi-sidebar-item-badge-ctn {
    color: #239ea0 !important;
}

/* Hide Filament sidebar collapse/expand buttons (not in reference design) */
.fi-sidebar .fi-sidebar-open-collapse-sidebar-btn,
.fi-sidebar .fi-sidebar-close-collapse-sidebar-btn {
    display: none !important;
}

.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-btn:hover {
    background-color: #e4f1ef !important;
}

/* Items inside labeled groups (sub-items) - simple text style, no card */
.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-btn {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.75rem !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-weight: 300 !important;
    color: #374151 !important;
}

/* Override label font weight for items inside groups */
.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-label {
    font-weight: 300 !important;
    color: #374151 !important;
}

/* Show icons for items inside labeled groups */
.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-icon {
    display: flex !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    color: #6b7280 !important;
    flex-shrink: 0 !important;
}

.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-btn:hover {
    background-color: transparent !important;
    color: #239ea0 !important;
}

.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-btn:hover .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-btn:hover .fi-sidebar-item-badge-ctn {
    color: #239ea0 !important;
}

.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background-color: transparent !important;
    color: #239ea0 !important;
    font-weight: 300 !important;
}

.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item.fi-active .fi-sidebar-item-label {
    font-weight: 300 !important;
    color: #239ea0 !important;
}

.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item.fi-active .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item.fi-active .fi-sidebar-item-btn .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item.fi-active .fi-sidebar-item-btn .fi-sidebar-item-badge-ctn {
    color: #239ea0 !important;
}

/* Sub-group items (deeper nesting) */
.fi-sidebar .fi-sidebar-sub-group-items {
    background-color: transparent !important;
    padding: 0.25rem 0 0 0.75rem !important;
    margin: 0 !important;
}

.fi-sidebar .fi-sidebar-sub-group-items .fi-sidebar-item-btn {
    font-size: 0.8125rem !important;
    padding: 0.5625rem 0.75rem 0.5rem 0.75rem !important;
    border: 0.0625rem solid #ddd !important;
    border-radius: 0.375rem !important;
    font-weight: 900 !important;
}

/* ========================================
   Badges
   ======================================== */
.fi-sidebar .fi-sidebar-item-badge-ctn {
    margin-left: auto !important;
}

/* ========================================
   Footer
   ======================================== */
.fi-sidebar .fi-sidebar-footer {
    border-top: 1px solid #e5e7eb !important;
    background-color: #ffffff !important;
    padding: 0.75rem !important;
}

/* ========================================
   DARK MODE STYLES
   ======================================== */
.dark aside.fi-sidebar.fi-main-sidebar {
    background-color: #1f2937 !important;
    border-inline-end-color: #374151 !important;
}

.dark .fi-sidebar .fi-sidebar-header-ctn,
.dark .fi-sidebar .fi-sidebar-header {
    background-color: #1f2937 !important;
    border-bottom-color: #374151 !important;
}

.dark .fi-sidebar .fi-logo-subtitle {
    color: #9ca3af !important;
}

.dark .fi-sidebar .fi-sidebar-nav {
    background-color: #1f2937 !important;
}

.dark .fi-sidebar .fi-sidebar-group-btn {
    color: #e5e7eb !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}

.dark .fi-sidebar .fi-sidebar-group-btn:hover {
    background-color: #374151 !important;
}

.dark .fi-sidebar .fi-sidebar-group.fi-active > .fi-sidebar-group-btn {
    background-color: rgba(20, 184, 166, 0.15) !important;
    border-color: rgba(20, 184, 166, 0.3) !important;
    color: #5eead4 !important;
}

.dark .fi-sidebar .fi-sidebar-group.fi-active .fi-sidebar-group-label {
    color: #5eead4 !important;
}

.dark .fi-sidebar .fi-sidebar-group-collapse-btn {
    color: #6b7280 !important;
}

.dark .fi-sidebar .fi-sidebar-group.fi-active .fi-sidebar-group-collapse-btn {
    color: #5eead4 !important;
}

.dark .fi-sidebar .fi-sidebar-item-btn {
    color: #e5e7eb !important;
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}

.dark .fi-sidebar .fi-sidebar-item-btn:hover {
    background-color: #374151 !important;
}

.dark .fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background-color: rgba(20, 184, 166, 0.15) !important;
    border-color: rgba(20, 184, 166, 0.3) !important;
    color: #5eead4 !important;
}

/* Dark mode: group items container background (only for labeled groups) */
.dark .fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) > .fi-sidebar-group-items {
    background-color: #111827 !important;
}

.dark .fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-btn {
    color: #9ca3af !important;
    background-color: transparent !important;
    border: none !important;
}

.dark .fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-icon {
    color: #6b7280 !important;
}

.dark .fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-btn:hover {
    background-color: transparent !important;
    color: #5eead4 !important;
}

.dark .fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item .fi-sidebar-item-btn:hover .fi-sidebar-item-icon {
    color: #5eead4 !important;
}

.dark .fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background-color: transparent !important;
    color: #5eead4 !important;
}

.dark .fi-sidebar .fi-sidebar-group:has(.fi-sidebar-group-btn) .fi-sidebar-group-items .fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: #5eead4 !important;
}

.dark .fi-sidebar .fi-sidebar-footer {
    border-top-color: #374151 !important;
    background-color: #1f2937 !important;
}

/* ========================================
   Breadcrumbs Bar
   ======================================== */

/* Remove the extra gap between topbar and page header */
.fi-topbar-ctn,
.fi-topbar {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.fi-page-header-main-ctn {
    row-gap: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Make header stack (breadcrumbs bar + content row) */
.fi-header.fi-header-has-breadcrumbs {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Full-width teal bar, flush under topbar */
.pharmacy-breadcrumbs-bar {
    background-color: #239ea0 !important;
    width: 100% !important;
    margin: 0 0 1.5rem 0 !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0 !important;
}

/* Full-bleed breadcrumbs bar (match topbar width), not constrained by fi-width-* */
@media (min-width: 1024px) {
    .pharmacy-breadcrumbs-bar {
        width: 100vw !important;
        margin-inline-start: calc(50% - 50vw) !important;
        margin-inline-end: calc(50% - 50vw) !important;
    }

    /* When sidebar pushes content, align bar with topbar (starts after sidebar) */
    .fi-main-ctn-sidebar-open .pharmacy-breadcrumbs-bar {
        width: calc(100vw - var(--pharmacy-sidebar-width)) !important;
        margin-inline-start: calc(50% - 50vw + (var(--pharmacy-sidebar-width) / 2)) !important;
        margin-inline-end: calc(50% - 50vw) !important;
    }
}

/* Breadcrumb component should not add its own background */
.pharmacy-breadcrumbs-bar .fi-breadcrumbs {
    background-color: transparent !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Header row below breadcrumbs */
.pharmacy-page-header-row {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    /* padding: 1.25rem 1.5rem 0 !important; */
}

.pharmacy-page-header-titles {
    min-width: 0 !important;
}

/* Hide the page heading in the content area (we render it in topbar) */
.fi-header-heading {
    display: none !important;
}

/* Breadcrumbs list */
.fi-breadcrumbs .fi-breadcrumbs-list {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Breadcrumb items */
.fi-breadcrumbs .fi-breadcrumbs-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}
.fi-ta-content-ctn {
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 1rem !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1) !important;
}
.fi-ta-ctn .fi-ta-header {
    border: none !important;
}
/* Breadcrumb labels and links */
.fi-breadcrumbs .fi-breadcrumbs-item-label,
.fi-breadcrumbs .fi-breadcrumbs-item-label a {
    color: #bbe1e2 !important;
    font-size: var(--text-sm) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}

/* Ensure breadcrumbs are visible on small screens */
@media (max-width: 768px) {
    .pharmacy-breadcrumbs-bar {
        display: block !important;
        visibility: visible !important;
        overflow: visible !important;
    }

    .fi-breadcrumbs,
    .fi-breadcrumbs-list,
    .fi-breadcrumbs-item,
    .fi-breadcrumbs-item-label,
    .fi-breadcrumbs-item-label a {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #bbe1e2 !important;
        font-size: 0.75rem !important;
    }

    .fi-breadcrumbs-item-label a {
        color: #bbe1e2 !important;
    }
}

/* Breadcrumb link hover */
.fi-breadcrumbs .fi-breadcrumbs-item-label a:hover {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* Breadcrumb separator icons */
.fi-breadcrumbs .fi-breadcrumbs-item-separator {
    color: #bbe1e2 !important;
    width: 1rem !important;
    height: 1rem !important;
}

/* Dark mode breadcrumbs */
.dark .pharmacy-breadcrumbs-bar {
    background-color: #239ea0 !important;
}

.dark .fi-breadcrumbs .fi-breadcrumbs-item-label,
.dark .fi-breadcrumbs .fi-breadcrumbs-item-label a {
    color: #bbe1e2 !important;
}

.dark .fi-breadcrumbs .fi-breadcrumbs-item-label a:hover {
    color: #ffffff !important;
}

.dark .fi-breadcrumbs .fi-breadcrumbs-item-separator {
    color: #bbe1e2 !important;
}

/* ========================================
   Panel content width tweaks
   ======================================== */

/* Full width when sidebar is closed */
.fi-main,
.fi-main.fi-width-7xl,
.fi-main.fi-width-screen {
    max-width: 100% !important;
    width: 100% !important;
}

/* Constrain width only when sidebar is open */
@media (min-width: 1024px) {
    .fi-main-ctn-sidebar-open .fi-main,
    .fi-main-ctn-sidebar-open .fi-main.fi-width-7xl {
        max-width: 100rem !important;
    }
}

/* ========================================
   Tables: header styling
   ======================================== */

/* Remove card styling from the table container */
.fi-ta-ctn {
    background-color: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

/* Apply card styling to the table itself */
.fi-ta-table {
    background-color: #ffffff !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1) !important;
    overflow: hidden !important;
    width: 100% !important;
}

/* Prevent table container from scrolling horizontally */
.fi-ta-content {
    overflow-x: auto !important;
}

/* Compact cells - no wrapping */
.fi-ta-table td,
.fi-ta-table th {
    white-space: nowrap !important;
}

/* Fixed width for actions column */
.fi-ta-table .fi-ta-actions-cell {
    width: 80px !important;
    min-width: 80px !important;
}

/* Header row background */
.fi-ta-table > thead,
.fi-ta-table > thead > tr {
    background-color: #239ea0 !important;
}

/* Header cells */
.fi-ta-table > thead > tr > th,
.fi-ta-table .fi-ta-header-cell {
    background-color: #239ea0 !important;
    color: #ffffff !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Remove border from last header cell */
.fi-ta-table > thead > tr > th:last-child,
.fi-ta-table .fi-ta-header-cell:last-child {
    border-right: none !important;
}

/* Table body rows */
.fi-ta-table > tbody > tr {
    border-bottom: 1px solid #e5e7eb !important;
}

/* Table body cells - vertical borders */
.fi-ta-table > tbody > tr > td,
.fi-ta-table .fi-ta-cell {
    border-right: 1px solid #e5e7eb !important;
}

/* Remove border from last cell in each row */
.fi-ta-table > tbody > tr > td:last-child,
.fi-ta-table .fi-ta-cell:last-child {
    border-right: none !important;
}

/* Reduce padding for header cells */
.fi-ta-table > thead > tr > th,
.fi-ta-table .fi-ta-header-cell {
    padding: 0.375rem 0.5rem !important;
}

/* Reduce padding for body cells */
.fi-ta-table > tbody > tr > td,
.fi-ta-table .fi-ta-cell {
    padding: 0.25rem 0.5rem !important;
}

/* Target inner cell wrapper */
.fi-ta-cell > div,
.fi-ta-table td > div {
    padding: 0 !important;
}

/* Target text column specifically */
.fi-ta-text {
    padding: 0 !important;
}

/* Target all column types */
.fi-ta-col-wrp {
    padding: 0 !important;
}

/* Sort button / header label inside th */
.fi-ta-table .fi-ta-header-cell-sort-btn,
.fi-ta-table .fi-ta-header-cell-sort-btn * {
    color: #ffffff !important;
}

/* Table toolbar layout: search + filters on one row */
.fi-ta-header-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
}

/* Separated tools bar above the table */
.pharmacy-table-tools-bar {
    background-color: #ffffff !important;
    border: 0.0625rem solid #eee !important;
    border-radius: 0.75rem !important;
    padding: 0.1rem 0.1rem !important;
    margin: 0 0 1rem !important;
}

/* Remove Filament toolbar divider line */
.fi-ta-ctn .fi-ta-header-toolbar {
    border-bottom: 0 !important;
}

/* Remove padding from table header container */
.fi-ta-ctn .fi-ta-header {
    padding: 0 !important;
}

/* Left/center cluster: search + filter + column manager */
.fi-ta-search-and-filters {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
    order: 1 !important;
    flex: 1 1 auto !important;
}

/* Give search field a sensible width and keep it on the same line */
.fi-ta-search-and-filters .fi-ta-search-field {
    flex: 0 0 20rem !important;
    min-width: 18rem !important;
}

/* Push filter / column manager triggers to the right edge of the left cluster */
.fi-ta-search-and-filters > :nth-child(2) {
    margin-inline-start: auto !important;
}

/* Keep actions cluster from collapsing weirdly */
.fi-ta-header-toolbar > .fi-ta-actions {
    flex: 0 0 auto !important;
    order: 2 !important;
    margin-inline-start: auto !important;
}

/* Small screens: search full width on top, filter + add button inline below */
@media (max-width: 768px) {
    .fi-ta-table > tbody > tr > td,
.fi-ta-table .fi-ta-cell {
    padding: 0.05rem 0rem !important;
}
    /* Main toolbar - flex row with wrap */
    .fi-ta-header-toolbar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        align-items: center !important;
    }

    /* Flatten the search-and-filters container */
    .fi-ta-search-and-filters {
        display: contents !important;
    }

    /* Search field - full width forces new row */
    .fi-ta-search-and-filters .fi-ta-search-field {
        flex: 0 0 100% !important;
        width: 100% !important;
        order: 1 !important;
    }

    /* Filter button - left side of second row */
    .fi-ta-search-and-filters > :not(.fi-ta-search-field) {
        order: 2 !important;
        flex: 0 0 auto !important;
    }

    /* Actions (Add Product) - right side of second row */
    .fi-ta-header-toolbar > .fi-ta-actions {
        order: 3 !important;
        flex: 1 1 auto !important;
        display: flex !important;
        justify-content: flex-end !important;
        margin: 0 !important;
    }

    /* Reduce button padding */
    .fi-ta-header-toolbar .fi-btn {
        padding-inline: 0.75rem !important;
    }

    /* ======================================
       Responsive Table - Card Layout
       ====================================== */

    /* Hide the table header */
    .fi-ta-table > thead {
        display: none !important;
    }

    /* Table body as block */
    .fi-ta-table > tbody {
        display: block !important;
    }

    /* Each row becomes a card */
    .fi-ta-table > tbody > tr {
        display: block !important;
        background-color: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 0.5rem !important;
        margin-bottom: 1rem !important;
        overflow: hidden !important;
    }

    /* Each cell becomes a row */
    .fi-ta-table > tbody > tr > td {
        display: flex !important;
        align-items: stretch !important;
        border: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: 2.5rem !important;
        white-space: normal !important;
        background: none !important;
    }

    .fi-ta-table > tbody > tr > td:last-child {
        border-bottom: none !important;
    }

    /* Reset any inner wrappers */
    .fi-ta-table > tbody > tr > td > div {
        display: contents !important;
    }

    /* Label area (left side with teal background) */
    .fi-ta-table > tbody > tr > td::before {
        display: flex !important;
        align-items: center !important;
        flex: 0 0 35% !important;
        min-width: 35% !important;
        max-width: 35% !important;
        background-color: #239ea0 !important;
        color: #ffffff !important;
        font-weight: 600 !important;
        font-size: 0.75rem !important;
        padding: 0.5rem 0.75rem !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Value area (right side) */
    .fi-ta-table > tbody > tr > td > * {
        flex: 1 !important;
        padding: 0.5rem 0.75rem !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
    }

    /* Remove table card styling on mobile */
    .fi-ta-table {
        background-color: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* Column labels - Products table */
    .fi-ta-table > tbody > tr > td:nth-child(1)::before { content: '#:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(2)::before { content: 'Img:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(3)::before { content: 'Name:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(4)::before { content: 'Category:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(5)::before { content: 'Drug Type:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(6)::before { content: 'Trade Name:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(7)::before { content: 'Pharmaceutical Form:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(8)::before { content: 'Strength Unit:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(9)::before { content: 'Package Type:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(10)::before { content: 'Manufacturer:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(11)::before { content: 'Price:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(12)::before { content: 'Publishing:' !important; }
    .fi-ta-table > tbody > tr > td:nth-child(13)::before { content: 'Action:' !important; }

    /* Actions cell full width */
    .fi-ta-table > tbody > tr > td:last-child {
        width: 100% !important;
    }
}

/* Table action buttons with primary background should have white text */
.fi-ta-actions .fi-btn.fi-color-primary,
.fi-ta-actions .fi-btn[style*="background-color: #239ea0"],
.fi-ta-actions .fi-btn.fi-btn-color-primary {
    color: #ffffff !important;
}

.fi-ta-actions .fi-btn.fi-color-primary .fi-btn-label,
.fi-ta-actions .fi-btn.fi-btn-color-primary .fi-btn-label {
    color: #ffffff !important;
}

.fi-ta-actions .fi-btn.fi-color-primary svg,
.fi-ta-actions .fi-btn.fi-btn-color-primary svg {
    color: #ffffff !important;
}

/* Item Bank Modal - Header styling */
.fi-modal:has(.item-bank-modal) .fi-modal-header {
    background-color: #e6f3ef !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 16px 24px !important;
}

/* Item Bank Modal - Style the form and actions in right panel */
#item-bank-form-container {
    margin-top: 16px;
}

#item-bank-form-container .fi-fo-component-ctn {
    width: 100%;
}

#item-bank-form-container .fi-modal-footer {
    position: static !important;
    width: 100% !important;
    padding: 0 !important;
    margin-top: 16px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

#item-bank-form-container .fi-modal-footer-actions {
    width: 100%;
    flex-direction: column;
    gap: 0;
}

#item-bank-form-container .fi-ac-btn-action,
#item-bank-form-container .fi-modal-footer-actions > * {
    width: 100%;
}

#item-bank-form-container .fi-btn {
    width: 100%;
    justify-content: center;
}
