/* ═══════════════════════════════════════════════════════════════════════════
   IMS — Inventory Management System
   Bootstrap 5 Custom Theme with calm, professional aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --ims-primary: #2563eb;
    --ims-secondary: #64748b;
    --ims-success: #10b981;
    --ims-danger: #ef4444;
    --ims-warning: #f59e0b;
    --ims-info: #3b82f6;
    --ims-dark: #1e293b;
    --ims-light: #f8fafc;
    --ims-sidebar-width: 260px;
    --ims-navbar-height: 56px;
}

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ims-dark);
    background-color: #f1f5f9;
    overflow-x: hidden;
}

/* ── Top Navbar ─────────────────────────────────────────────────────────────── */
.ims-navbar {
    height: var(--ims-navbar-height);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1030;
}

/* Internal Staff Top Navbar - Deep Navy / Royal Blue */
.ims-navbar-internal {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Customer Portal Top Navbar - Sleek Neutral Charcoal */
.ims-navbar-customer {
    background: #18181b !important;
    border-bottom: 1px solid #27272a !important;
}

/* ── Sidebar Navigation ────────────────────────────────────────────────────── */
.ims-sidebar {
    position: fixed;
    top: var(--ims-navbar-height);
    left: 0;
    width: var(--ims-sidebar-width);
    height: calc(100vh - var(--ims-navbar-height));
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
    z-index: 1045;
}

@media (max-width: 991.98px) {
    .ims-sidebar {
        position: fixed;
        top: var(--ims-navbar-height);
        left: 0;
        right: 0;
        width: 100vw;
        height: auto;
        max-height: calc(85vh - var(--ims-navbar-height));
        transform: none !important;
        display: none;
        overflow-y: auto;
        border-right: none;
        border-bottom: 2px solid rgba(226, 232, 240, 0.8);
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15);
        z-index: 1050;
    }
    .ims-sidebar.show {
        display: flex !important;
        animation: slideDownMenu 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

@keyframes slideDownMenu {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ims-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1040;
    animation: fadeIn 0.2s ease-out;
}

.ims-nav-inner {
    padding: 0;
}

.ims-nav-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 0.875rem 1rem 0.375rem;
}

.ims-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    border-left: 3px solid transparent;
    border-radius: 0.375rem;
    margin: 0.125rem 0.375rem;
}

.ims-nav-link i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
    color: #2563eb;
}

.ims-nav-link:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.ims-nav-link.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-left-color: #2563eb;
    font-weight: 600;
}

/* Ensure blue backgrounds never use black/blue text on top of blue surfaces */
.bg-primary,
.bg-primary *,
.bg-info,
.bg-info *,
.btn-primary,
.btn-primary *,
.btn-info,
.btn-info *,
.badge.bg-primary,
.badge.bg-primary *,
.badge.bg-info,
.badge.bg-info *,
.badge-primary,
.badge-primary *,
.badge-info,
.badge-info *,
.bg-primary-subtle,
.bg-primary-subtle *,
.bg-info-subtle,
.bg-info-subtle *,
.badge-primary-subtle,
.badge-primary-subtle *,
.badge-info-subtle,
.badge-info-subtle *,
.ims-badge-primary,
.ims-badge-primary *,
.ims-badge-info,
.ims-badge-info *,
.alert-primary,
.alert-primary *,
.alert-info,
.alert-info *,
.gradient-bg-blue,
.gradient-bg-blue *,
.bg-primary.text-dark,
.bg-primary.text-dark *,
.bg-primary.text-black,
.bg-primary.text-black *,
.bg-primary.text-primary,
.bg-primary.text-primary *,
.bg-primary.text-info,
.bg-primary.text-info *,
.bg-primary.text-muted,
.bg-primary.text-muted *,
.bg-primary.text-secondary,
.bg-primary.text-secondary *,
.bg-info.text-dark,
.bg-info.text-dark *,
.bg-info.text-black,
.bg-info.text-black *,
.bg-info.text-primary,
.bg-info.text-primary *,
.bg-info.text-info,
.bg-info.text-info *,
.bg-info.text-muted,
.bg-info.text-muted *,
.bg-info.text-secondary,
.bg-info.text-secondary * {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* Ensure any blue element has solid background with full opacity so white text is crystal clear */
.badge.bg-primary,
.badge.bg-info,
.badge[class*="bg-primary"],
.badge[class*="bg-info"],
.cust-kpi-icon.bg-primary,
.cust-kpi-icon.bg-info,
.cust-kpi-icon[class*="bg-primary"],
.cust-kpi-icon[class*="bg-info"],
.bg-primary.bg-opacity-10,
.bg-primary.bg-opacity-20 {
    --bs-bg-opacity: 1 !important;
    background-color: var(--ims-primary) !important;
    border-color: var(--ims-primary) !important;
    color: #ffffff !important;
}

.bg-info.bg-opacity-10,
.bg-info.bg-opacity-20,
.badge.bg-info,
.badge[class*="bg-info"],
.cust-kpi-icon.bg-info {
    --bs-bg-opacity: 1 !important;
    background-color: var(--ims-info) !important;
    border-color: var(--ims-info) !important;
    color: #ffffff !important;
}

.bg-primary a,
.bg-info a,
.btn-primary a,
.btn-info a,
.badge.bg-primary a,
.badge.bg-info a,
.bg-primary-subtle a,
.bg-info-subtle a {
    color: #ffffff !important;
}

.table-primary,
.table-primary > th,
.table-primary > td {
    background-color: var(--ims-primary) !important;
    color: #ffffff !important;
}

.table-primary > th *,
.table-primary > td * {
    color: #ffffff !important;
}

/* Internal Staff Sidebar Custom Override (No Heavy Dark Background) */
.ims-sidebar-internal {
    background: #ffffff !important;
}

.ims-sidebar-internal .ims-sidebar-brand {
    border-bottom: 1px solid #e2e8f0 !important;
}

.ims-sidebar-internal .ims-sidebar-brand .fw-bold,
.ims-sidebar-internal .ims-sidebar-brand .text-white {
    color: #0f172a !important;
}

.ims-sidebar-internal .ims-sidebar-brand .text-slate-400 {
    color: #64748b !important;
}

.ims-sidebar-internal .input-group {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

.ims-sidebar-internal .input-group .input-group-text,
.ims-sidebar-internal .input-group .text-slate-400 {
    color: #64748b !important;
}

.ims-sidebar-internal .input-group input {
    color: #0f172a !important;
}

.ims-sidebar-internal .input-group input::placeholder {
    color: #94a3b8 !important;
}

.ims-sidebar-internal .ims-sidebar-footer {
    border-top: 1px solid #e2e8f0 !important;
}

.ims-sidebar-internal .ims-sidebar-footer > div {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

.ims-sidebar-internal .ims-sidebar-footer .text-white {
    color: #0f172a !important;
}

.ims-sidebar-internal .ims-sidebar-footer .text-slate-400 {
    color: #64748b !important;
}

.ims-sidebar-internal .ims-sidebar-footer .btn {
    color: #64748b !important;
}

.ims-sidebar-internal .ims-sidebar-footer .btn:hover {
    color: #ef4444 !important;
}

/* Dedicated Customer Sidebar Theme - Sleek Neutral Charcoal */
.ims-sidebar-customer {
    background: #18181b !important;
    border-right: 1px solid #27272a !important;
}

.ims-sidebar-customer .ims-sidebar-brand {
    border-bottom: 1px solid #27272a !important;
}

.ims-sidebar-customer .ims-sidebar-brand .fw-bold,
.ims-sidebar-customer .ims-sidebar-brand .text-white {
    color: #f4f4f5 !important;
}

.ims-sidebar-customer .ims-sidebar-brand .text-slate-400 {
    color: #a1a1aa !important;
}

.ims-sidebar-customer .input-group {
    background-color: #27272a !important;
    border-color: #3f3f46 !important;
}

.ims-sidebar-customer .input-group .input-group-text,
.ims-sidebar-customer .input-group .text-slate-400 {
    color: #a1a1aa !important;
}

.ims-sidebar-customer .input-group input {
    color: #f4f4f5 !important;
}

.ims-sidebar-customer .input-group input::placeholder {
    color: #71717a !important;
}

.ims-sidebar-customer .ims-nav-section-label {
    color: #a1a1aa !important;
}

.ims-sidebar-customer .ims-nav-section-label i,
.ims-sidebar-customer .ims-nav-section-label span {
    color: #a1a1aa !important;
}

.ims-sidebar-customer .ims-nav-section-label:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

.ims-sidebar-customer .ims-nav-section-label:hover i,
.ims-sidebar-customer .ims-nav-section-label:hover span {
    color: #ffffff !important;
}

.ims-sidebar-customer .ims-nav-link {
    color: #d4d4d8 !important;
}

.ims-sidebar-customer .ims-nav-link i {
    color: #a1a1aa !important;
}

.ims-sidebar-customer .ims-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

.ims-sidebar-customer .ims-nav-link:hover i {
    color: #ffffff !important;
}

.ims-sidebar-customer .ims-nav-link.active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-left-color: #ffffff !important;
    font-weight: 600;
}

.ims-sidebar-customer .ims-nav-link.active i {
    color: #ffffff !important;
}

/* ── Main Content Area ─────────────────────────────────────────────────────── */
.ims-main-content {
    margin-left: var(--ims-sidebar-width);
    min-height: calc(100vh - var(--ims-navbar-height));
    background-color: #f8fafc;
    padding: 1.75rem 2rem;
    transition: margin-left 0.3s ease;
}

@media (max-width: 991.98px) {
    .ims-main-content {
        margin-left: 0;
        padding: 1rem 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .ims-main-content {
        padding: 0.75rem 0.75rem;
    }
}

/* ── Single-Row KPI Container ────────────────────────────────────────────── */
.ims-kpi-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

.ims-kpi-col {
    flex: 1 1 0px;
    min-width: 0;
}

/* ── KPI Dashboard Cards ───────────────────────────────────────────────────── */
.ims-kpi-card {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ims-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.ims-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ims-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ims-kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.ims-kpi-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Responsive Card & Font Scaling for laptops & smaller screens */
@media (max-width: 1400px) {
    .ims-kpi-container {
        gap: 0.5rem;
    }
    .ims-kpi-card {
        padding: 0.75rem 0.85rem;
        border-radius: 10px;
    }
    .ims-kpi-value {
        font-size: 1.3rem;
    }
    .ims-kpi-icon {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }
    .ims-kpi-label {
        font-size: 0.65rem;
    }
    .ims-kpi-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
}

@media (max-width: 1100px) {
    .ims-kpi-card {
        padding: 0.625rem 0.65rem;
    }
    .ims-kpi-value {
        font-size: 1.15rem;
    }
    .ims-kpi-icon {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }
    .ims-kpi-label {
        font-size: 0.6rem;
    }
    .ims-kpi-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.35rem;
    }
}

@media (max-width: 768px) {
    .ims-kpi-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    .ims-kpi-col {
        flex: 0 0 150px;
        min-width: 150px;
    }
}

/* ── Table Cards ───────────────────────────────────────────────────────────── */
.ims-table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.ims-table-card.h-100 {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ims-table-card.h-100 .table-responsive {
    flex: 1;
}

.ims-table-toolbar {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9375rem;
}

@media (max-width: 575.98px) {
    .ims-table-toolbar {
        padding: 0.75rem;
    }
    
    .ims-table-toolbar > div,
    .ims-table-toolbar > input,
    .ims-table-toolbar > select {
        width: 100%;
    }
}

/* Responsive Table Padding Scaling */
@media (max-width: 1400px) {
    .table > thead > tr > th,
    .table > tbody > tr > td {
        padding: 0.55rem 0.75rem;
        font-size: 0.8375rem;
    }
    .ims-table-toolbar {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 1200px) {
    .table > thead > tr > th,
    .table > tbody > tr > td {
        padding: 0.45rem 0.65rem;
        font-size: 0.8125rem;
    }
}

/* ── Login Page ────────────────────────────────────────────────────────────── */
.ims-login-panel {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    padding: 3rem;
}

.text-blue {
    color: var(--ims-primary) !important;
}

.text-white {
    color: white !important;
}

/* ── Animation Helpers ─────────────────────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── Table Enhancements & Single Line Formatting ───────────────────────────── */
.table th,
.table td,
.ims-table-card th,
.ims-table-card td {
    white-space: nowrap !important;
    vertical-align: middle;
}

.table td .d-flex,
.table th .d-flex {
    flex-wrap: nowrap !important;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

.cursor-pointer {
    cursor: pointer;
    user-select: none;
}

/* ── Form Controls ─────────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--ims-primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.rounded-3 {
    border-radius: 0.75rem !important;
}

.rounded-4 {
    border-radius: 1rem !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* ── Blazor Reconnect Modal ────────────────────────────────────────────────── */
#components-reconnect-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    max-width: 400px;
}

/* ── Accessibility Enhancements ───────────────────────────────────────────────── */
/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--ims-primary);
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ims-primary);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-to-main:focus {
    top: 0;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card,
    .btn,
    .form-control,
    .form-select {
        border: 2px solid currentColor;
    }
}

/* ── Responsive Design Enhancements ───────────────────────────────────────────── */
/* Responsive table wrapper */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* Mobile & Tablet UI/UX Typography & Element Scaling */
@media (max-width: 767.98px) {
    body {
        font-size: 0.875rem;
    }

    h1, .h1 {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
    }
    
    h2, .h2 {
        font-size: 1.2rem !important;
        line-height: 1.3 !important;
    }
    
    h3, .h3 {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
    }
    
    h4, .h4 {
        font-size: 1rem !important;
    }

    h5, .h5 {
        font-size: 0.9375rem !important;
    }

    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .row.g-4 > [class*="col-"] {
        padding-bottom: 0.75rem;
    }
    
    /* Table Cells & Headers */
    .table th,
    .table td,
    .ims-table-card th,
    .ims-table-card td {
        font-size: 0.8125rem !important;
        padding: 0.5rem 0.625rem !important;
    }

    .table .btn-sm {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* KPI Value & Typography Scaling */
    .ims-kpi-value {
        font-size: 1.375rem !important;
    }

    .ims-kpi-label {
        font-size: 0.7rem !important;
        letter-spacing: 0.3px !important;
    }

    .ims-kpi-badge {
        font-size: 0.6875rem !important;
        padding: 0.2rem 0.45rem !important;
    }
    
    .ims-kpi-icon {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
    }

    /* Form Controls & Buttons */
    .form-control,
    .form-select {
        font-size: 0.875rem !important;
        padding: 0.45rem 0.75rem !important;
    }

    .form-label {
        font-size: 0.8125rem !important;
        margin-bottom: 0.25rem !important;
    }

    .btn {
        padding: 0.45rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Mobile Header Brand & Navigation links */
    .ims-nav-link {
        font-size: 0.8125rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    .ims-nav-section-label {
        font-size: 0.625rem !important;
        padding: 0.625rem 0.75rem 0.25rem !important;
    }
}

/* Touch-friendly targets for mobile form controls */
@media (hover: none) and (pointer: coarse) {
    .form-control,
    .form-select {
        min-height: 40px;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 991.98px) and (orientation: landscape) {
    .ims-sidebar {
        height: calc(100vh - var(--ims-navbar-height));
        max-height: 65vh;
    }
}

/* ── Product UI polish ───────────────────────────────────────────────────────
       Keep the application practical and familiar: one restrained blue accent,
       quiet surfaces, consistent spacing, and controls that read like a business
       application rather than a marketing dashboard. This block intentionally
       comes last so it is the single source of truth over page-level utilities.
    */
 :root {
        --ims-primary: #285ea8;
        --ims-primary-dark: #1f4b87;
        --ims-ink: #243247;
        --ims-muted: #667085;
        --ims-border: #d9e0e8;
        --ims-surface: #ffffff;
        --ims-page: #f4f6f8;
        --ims-sidebar-width: 244px;
        --ims-navbar-height: 58px;
    }

html, body {
        font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
        color: var(--ims-ink);
        background: var(--ims-page);
    }

body {
        font-size: .9rem;
        line-height: 1.5;
    }

.ims-navbar,
    .ims-navbar-internal {
        background: #183a63 !important;
        border-bottom: 1px solid #102c4b;
        box-shadow: 0 1px 3px rgba(16, 44, 75, .18);
    }

    .ims-navbar-customer {
        background: #344b62 !important;
        border-bottom-color: #293d50 !important;
    }

    .ims-sidebar,
    .ims-sidebar-internal {
        background: #fff !important;
        border-right: 1px solid var(--ims-border);
        box-shadow: 1px 0 3px rgba(31, 49, 72, .03);
    }

    .ims-sidebar-container {
        background: #fff !important;
        color: var(--ims-ink);
    }

    .ims-sidebar-brand {
        min-height: 70px;
        padding: 1rem 1.1rem !important;
        border-bottom: 1px solid var(--ims-border) !important;
    }

    .ims-sidebar-brand .fw-bold,
    .ims-sidebar-brand .text-white {
        color: #20344c !important;
    }

    .ims-sidebar-brand .text-slate-400,
    .ims-sidebar-brand small {
        color: #7b8796 !important;
    }

    .ims-sidebar-brand .brand-icon-box {
        width: 34px !important;
        height: 34px !important;
        color: #fff !important;
        background: var(--ims-primary) !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .ims-sidebar-brand .badge {
        color: #56708c !important;
        background: #eef3f8 !important;
        border: 1px solid #dce5ee !important;
    }

    .ims-sidebar .input-group {
        background: #f7f9fb !important;
        border: 1px solid var(--ims-border) !important;
        border-radius: 4px !important;
    }

    .ims-sidebar .input-group input {
        color: var(--ims-ink) !important;
    }

    .ims-sidebar .input-group input::placeholder {
        color: #98a3b1 !important;
    }

    .ims-sidebar .input-group .input-group-text {
        color: #8090a1 !important;
    }

    .ims-nav-section-label {
        color: #8290a0 !important;
        padding: .7rem .85rem .35rem !important;
    }

    .ims-nav-section-label > div > i {
        display: none;
    }

    .ims-nav-section-label .bi-chevron-down {
        display: inline-block;
    }

    .ims-nav-link,
    .ims-sidebar-customer .ims-nav-link {
        color: #536174 !important;
        border-left: 2px solid transparent !important;
        border-radius: 4px !important;
        margin: 1px .35rem !important;
        padding: .55rem .8rem !important;
        font-weight: 500;
    }

    .ims-nav-link i,
    .ims-sidebar-customer .ims-nav-link i {
        color: #7e8c9d !important;
        font-size: .95rem !important;
    }

    .ims-nav-link:hover,
    .ims-sidebar-customer .ims-nav-link:hover {
        background: #f2f5f8 !important;
        color: #203e62 !important;
    }

    .ims-nav-link.active,
    .ims-sidebar-customer .ims-nav-link.active {
        background: #eaf1f8 !important;
        color: #1e5794 !important;
        border-left-color: var(--ims-primary) !important;
        box-shadow: none !important;
    }

    .ims-nav-link.active i,
    .ims-sidebar-customer .ims-nav-link.active i {
        color: var(--ims-primary) !important;
    }

    .ims-main-content {
        background: var(--ims-page);
        padding: 1.5rem 1.75rem;
    }

    .ims-page-header {
        padding-bottom: .9rem;
        border-bottom: 1px solid var(--ims-border);
    }

    .ims-page-header h1,
    .ims-page-header h2,
    .ims-page-header h3 {
        color: #26384d !important;
        font-weight: 650 !important;
        letter-spacing: -.01em;
    }

    .ims-page-header p {
        color: var(--ims-muted) !important;
    }

    .card,
    .ims-card,
    .ims-table-card,
    .ims-kpi-card {
        border: 1px solid var(--ims-border) !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 2px rgba(31, 49, 72, .04) !important;
    }

    .card:hover,
    .ims-kpi-card:hover,
    .ims-table-card:hover {
        transform: none !important;
        box-shadow: 0 2px 6px rgba(31, 49, 72, .08) !important;
    }

    .card-header,
    .ims-table-toolbar {
        background: #fafbfc !important;
        border-bottom: 1px solid var(--ims-border) !important;
    }

    .table > thead > tr > th {
        background: #f7f9fb !important;
        color: #66768a !important;
        font-size: .7rem;
        letter-spacing: .045em;
    }

    .table > tbody > tr > td {
        color: #35465a;
        border-color: #edf0f3;
    }

    .table-hover tbody tr:hover > * {
        background: #f8fafc !important;
    }

    .form-label {
        color: #425368 !important;
        font-weight: 600 !important;
        margin-bottom: .35rem !important;
    }

    .form-control,
    .form-select {
        min-height: 38px;
        color: #26384d !important;
        background: #fff !important;
        border: 1px solid #cbd5df !important;
        border-radius: 4px !important;
        box-shadow: none !important;
    }

    textarea.form-control {
        min-height: 92px;
    }

    .form-control::placeholder,
    .form-select::placeholder {
        color: #9aa6b4 !important;
        opacity: 1;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: #6d98c3 !important;
        box-shadow: 0 0 0 2px rgba(40, 94, 168, .12) !important;
    }

    .input-group-text {
        color: #718096 !important;
        background: #f7f9fb !important;
        border: 1px solid #cbd5df !important;
    }

    .btn {
        border-radius: 4px !important;
        font-weight: 600;
        box-shadow: none !important;
    }

    .btn-primary {
        background: var(--ims-primary) !important;
        border-color: var(--ims-primary) !important;
        color:white
    }

    .btn-primary:hover,
    .btn-primary:focus {
        background: var(--ims-primary-dark) !important;
        border-color: var(--ims-primary-dark) !important;
    }

    .btn-light,
    .btn-outline-secondary {
        border-color: #cbd5df !important;
        color: #516174 !important;
        background: #fff !important;
    }

    .badge {
        font-weight: 600;
        letter-spacing: 0;
    }

    .alert {
        border-radius: 4px !important;
        border-width: 1px !important;
    }

    .modal-content {
        border: 1px solid var(--ims-border) !important;
        border-radius: 6px !important;
        box-shadow: 0 14px 35px rgba(21, 39, 60, .18) !important;
    }

    .ims-modal-header {
        background: #fafbfc !important;
        border-radius: 6px 6px 0 0 !important;
    }

    .ims-auth-page {
        background-color: #eef2f6 !important;
    }

    .ims-auth-page > .container,
    .ims-auth-page > .container-fluid {
        max-width: 920px !important;
    }

    .ims-auth-page .card {
        border-radius: 6px !important;
        background: #fff !important;
        backdrop-filter: none !important;
    }

    .ims-auth-page .ims-login-panel {
        background: #183a63 !important;
    }

    .ims-auth-page .form-control {
        min-height: 42px;
    }

    .ims-auth-page .input-group-text {
        background: #f7f9fb !important;
    }

    .ims-auth-page .text-white {
        color: #fff !important;
    }

.ims-auth-customer .text-dark {
    color: #26384d !important;
}

@media (max-width: 991.98px) {
    .ims-main-content {
        padding: 1.1rem 1rem;
    }
}

/* ── Modern Modal System ───────────────────────────────────────────────────── */
.ims-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1050;
    animation: fadeIn 0.2s ease-out;
}

.ims-modal-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1055;
    overflow-y: auto;
    animation: fadeIn 0.2s ease-out;
}

.ims-modal-wrap .modal-dialog {
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ims-modal-wrap .modal-content {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.ims-modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    border-radius: 1rem 1rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ims-modal-header .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.ims-modal-header .btn-close {
    padding: 0.75rem;
    margin: -0.75rem -0.75rem -0.75rem auto;
    opacity: 0.5;
    transition: all 0.15s ease;
}

.ims-modal-header .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.ims-modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 1rem 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Modal animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced form styling inside modals */
.ims-modal-wrap .modal-body {
    padding: 1.5rem 1.75rem;
    background: #ffffff;
}
.modal-body .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.modal-body .form-control,
.modal-body .form-select {
    border: 1.5px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--ims-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-body .input-group-text {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-right: none;
    color: #64748b;
    font-weight: 500;
}

.modal-body .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #cbd5e1;
    cursor: pointer;
}

.modal-body .form-check-input:checked {
    background-color: var(--ims-primary);
    border-color: var(--ims-primary);
}

.modal-body .form-check-label {
    cursor: pointer;
    margin-left: 0.5rem;
    color: #475569;
}

/* Darker checkbox border */
.darker-border-checkbox {
    border-color: #94a3b8 !important;
}

/* ── Customer brand system ──────────────────────────────────────────────── */
.customer-portal-layout {
    --customer-navy: #0b1f3a;
    --customer-blue: #1261a0;
    --customer-cyan: #18a6b8;
    --customer-gold: #f4b942;
    background: #f3f7fb;
}

.customer-portal-layout .portal-navbar {
    min-height: 76px;
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 8px 26px rgba(11, 31, 58, 0.08);
    backdrop-filter: blur(16px);
}

.customer-portal-layout .portal-logo-badge {
    width: 44px;
    height: 44px;
    color: #fff;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--customer-navy), var(--customer-blue) 58%, var(--customer-cyan));
    box-shadow: 0 8px 18px rgba(18, 97, 160, 0.28);
}

.customer-portal-layout .portal-sidebar {
    width: 272px;
    background: linear-gradient(180deg, #0b1f3a 0%, #10345a 55%, #0e4260 100%);
    border-right: 0;
    box-shadow: 10px 0 34px rgba(11, 31, 58, 0.12);
}

.customer-portal-layout .portal-nav-menu {
    padding: 1.4rem 1rem;
}

.customer-portal-layout .portal-nav-label {
    color: rgba(226, 242, 250, 0.58) !important;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    padding: 1.2rem 0.85rem 0.45rem;
}

.customer-portal-layout .portal-nav-item {
    margin: 0.25rem 0;
    padding: 0.78rem 0.9rem;
    color: rgba(255, 255, 255, 0.78) !important;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.customer-portal-layout .portal-nav-item:hover,
.customer-portal-layout .portal-nav-item.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateX(3px);
}

.customer-portal-layout .portal-nav-item i {
    color: #7ed9e5 !important;
}

.customer-portal-layout .portal-nav-item.active i {
    color: var(--customer-gold) !important;
}

.customer-portal-layout .portal-navbar {
    position: sticky;
    top: 0;
    z-index: 40;
}

.customer-portal-layout .portal-navbar .btn,
.customer-portal-layout .portal-navbar .dropdown-toggle {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.customer-portal-layout .portal-navbar .btn:hover,
.customer-portal-layout .portal-navbar .dropdown-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(18, 97, 160, 0.12);
}

.customer-portal-layout .portal-avatar {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b1f3a, #1261a0);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 8px 18px rgba(18, 97, 160, 0.22);
}

.customer-portal-layout .dropdown-menu {
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    box-shadow: 0 20px 35px rgba(11, 31, 58, 0.12) !important;
    border-radius: 18px !important;
    padding: 0.5rem !important;
}

.customer-portal-layout .dropdown-item {
    border-radius: 12px;
    transition: background 0.2s ease, color 0.2s ease;
}

.customer-portal-layout .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(18, 97, 160, 0.08), rgba(24, 166, 184, 0.08));
    color: #0b1f3a;
}

.customer-portal-layout .customer-portal-main {
    background:
        radial-gradient(circle at 90% 0%, rgba(24, 166, 184, 0.1), transparent 26rem),
        #f3f7fb;
    padding: 1.7rem clamp(1rem, 3vw, 2.8rem) 3rem;
}

.customer-portal-layout .customer-portal-main .nav-pills {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 10px 24px rgba(11, 31, 58, 0.04);
    backdrop-filter: blur(10px);
}

.customer-portal-layout .customer-portal-main .nav-link {
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.customer-portal-layout .customer-portal-main .nav-link:hover {
    transform: translateY(-1px);
}

.customer-portal-layout .customer-portal-main .card {
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 28px rgba(11, 31, 58, 0.06) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.customer-portal-layout .customer-portal-main .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(11, 31, 58, 0.08) !important;
}

.customer-portal-layout .customer-portal-main .card-header,
.customer-portal-layout .customer-portal-main .card-footer {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(148, 163, 184, 0.22);
}

.customer-portal-layout .customer-portal-main .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.customer-portal-layout .customer-portal-main .table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: #475569;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.customer-portal-layout .customer-portal-main .table tbody td {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.14);
}

.customer-portal-layout .customer-portal-main .table tbody tr:hover {
    background: rgba(18, 97, 160, 0.03);
}

.customer-portal-layout .customer-portal-main .btn,
.customer-portal-layout .customer-portal-main .badge {
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.customer-portal-layout .customer-portal-main .btn:hover,
.customer-portal-layout .customer-portal-main .badge:hover {
    transform: translateY(-1px);
}

.customer-portal-layout .customer-portal-main .btn[style*="linear-gradient"] {
    border: 0 !important;
    box-shadow: 0 10px 18px rgba(17, 24, 39, 0.06);
}

.customer-portal-layout .customer-portal-main .badge {
    letter-spacing: 0.02em;
}

@media (max-width: 767.98px) {
    .customer-portal-layout .portal-navbar {
        min-height: 70px;
        padding-inline: 0.85rem !important;
    }

    .customer-portal-layout .portal-navbar .btn {
        padding-inline: 0.8rem;
    }

    .customer-portal-layout .customer-portal-main {
        padding: 1rem 0.85rem 2rem;
    }

    .customer-portal-layout .customer-portal-main .nav-pills {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .customer-portal-layout .customer-portal-main .nav-item {
        display: inline-flex;
    }
}

.customer-hero-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 185px;
    margin: 0 auto 1.8rem;
    max-width: 1320px;
    padding: 2rem clamp(1.4rem, 4vw, 3rem);
    overflow: hidden;
    color: #fff;
    border-radius: 24px;
    background:
        linear-gradient(105deg, rgba(7, 24, 48, 0.92), rgba(18, 97, 160, 0.78) 58%, rgba(24, 166, 184, 0.68)),
        url('/hero.jpeg') center / cover;
    box-shadow: 0 18px 42px rgba(11, 31, 58, 0.18);
}

.customer-hero-banner::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: 10%;
    top: -150px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.04), 0 0 0 58px rgba(255, 255, 255, 0.03);
}

.customer-hero-banner > div {
    position: relative;
    z-index: 1;
}

.customer-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    color: #b8eff3;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.customer-hero-banner h1 {
    margin: 0;
    max-width: 720px;
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    font-weight: 750;
    letter-spacing: -0.035em;
}

.customer-hero-banner p {
    max-width: 650px;
    margin: 0.5rem 0 0;
    color: rgba(255, 255, 255, 0.78);
}

.customer-hero-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    flex: 0 0 auto;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 2rem;
    backdrop-filter: blur(8px);
}

.customer-portal-layout .customer-portal-main .card {
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(11, 31, 58, 0.06) !important;
}

.customer-portal-layout .customer-portal-main .btn-primary,
.customer-login-page .btn-primary {
    border: 0;
    background: linear-gradient(135deg, var(--customer-blue), var(--customer-cyan));
    box-shadow: 0 8px 18px rgba(18, 97, 160, 0.22);
}

.customer-portal-layout .customer-portal-main .btn-primary:hover,
.customer-login-page .btn-primary:hover {
    background: linear-gradient(135deg, #0d4f86, #128b9c);
    transform: translateY(-1px);
}

.customer-login-page {
    position: relative;
    --customer-blue: #1261a0;
    --customer-cyan: #18a6b8;
    background:
        linear-gradient(115deg, rgba(5, 20, 41, 0.9), rgba(10, 74, 112, 0.72)),
        url('/hero.jpeg') center / cover fixed;
}

.customer-login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 18%, rgba(126, 217, 229, 0.24), transparent 24rem);
    pointer-events: none;
}

.customer-login-page > .container {
    position: relative;
    z-index: 1;
}

.customer-login-page .card {
    box-shadow: 0 28px 80px rgba(3, 15, 32, 0.34) !important;
}

.customer-login-welcome {
    min-height: 570px;
    background:
        linear-gradient(145deg, rgba(9, 31, 60, 0.92), rgba(18, 97, 160, 0.78)),
        url('/hero.jpeg') center / cover;
}

@media (max-width: 991.98px) {
    .customer-portal-layout .customer-portal-main {
        padding: 1rem 0.85rem 2rem;
    }

    .customer-hero-banner {
        min-height: 160px;
        margin-bottom: 1.2rem;
        border-radius: 18px;
    }

    .customer-hero-mark {
        display: none;
    }
}

/* Validation messages */
.validation-message {
    font-size: 0.8125rem;
    color: var(--ims-danger);
    margin-top: 0.375rem;
    display: block;
}

/* Responsive modal */
@media (max-width: 767.98px) {
    .ims-modal-wrap .modal-dialog {
        max-width: 95% !important;
        margin: 0.5rem;
    }
    
    .ims-modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    .ims-modal-header .modal-title {
        font-size: 1.125rem;
    }
    
    .ims-modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column-reverse;
    }
    
    .ims-modal-footer .btn {
        width: 100%;
    }
}

/* Print styles */
@media print {
    .ims-sidebar,
    .ims-navbar,
    .btn,
    .pagination,
    .ims-modal-backdrop,
    .ims-modal-wrap,
    #components-reconnect-modal {
        display: none !important;
    }
    
    .ims-main-content {
        margin-left: 0 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        background: white;
        color: black;
    }
}


/* ── Receipt Items Dropdown - High Z-Index Fix ─────────────────────────────────── */
.ims-table-card {
  position: relative;
  z-index: 1;
}

.ims-table-card .table-responsive {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
}

.ims-table-card table {
  position: relative;
  z-index: 1;
}

.dropdown-menu li:last-child {
  border-bottom: none !important;
}

.dropdown-menu li:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

.ims-table-card .dropdown-toggle {
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  position: relative;
  z-index: 1050;
}

.ims-table-card .dropdown-menu {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  position: absolute !important;
  z-index: 9999 !important;
  background: white !important;
}

.ims-table-card .dropdown {
  position: relative;
}

.ims-table-card tbody .dropdown {
  position: relative;
  z-index: 1050;
}

.ims-table-card tbody tr {
  position: relative;
  z-index: 1;
}

.ims-table-card .dropdown.show {
  z-index: 9998 !important;
}

/* Global dropdown menu override for tables */
.table-responsive .dropdown-menu,
.ims-table-card .dropdown-menu {
  z-index: 9999 !important;
}

/* Force dropdown to be appended to body for proper z-index stacking */
body > .dropdown-menu {
  z-index: 9999 !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   Workflow Timeline Styles
   ══════════════════════════════════════════════════════════════════════════ */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.875rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    z-index: 1;
    box-shadow: 0 0 0 4px #fff;
}

.timeline-item.completed .timeline-marker {
    animation: pulse 0.5s ease-in-out;
}

.timeline-content {
    padding-left: 1rem;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Purchase Requisitions - Action Buttons Styling
   ═══════════════════════════════════════════════════════════════════════════ */

/* Button group improvements */
.btn-group-sm .btn {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-group-sm .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-group-sm .btn:active {
    transform: translateY(0);
}

/* View button */
.btn-light {
    background-color: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-light:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

/* Submit button */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Approve button */
.btn-success i {
    margin-right: 0.25rem;
}

/* Reject button */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-danger i {
    margin-right: 0.25rem;
}

/* Convert to RFQ button */
.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-info i {
    margin-right: 0.25rem;
}

/* RFQ Created (disabled) button */
.btn-secondary {
    background-color: #94a3b8;
    color: white;
    cursor: not-allowed;
    opacity: 0.75;
}

.btn-secondary:hover {
    background-color: #94a3b8;
    transform: none;
}

/* Icon spacing in buttons */
.btn i {
    font-size: 1rem;
    vertical-align: middle;
}

/* Button group spacing */
.btn-group .btn {
    margin-right: -1px;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    margin-right: 0;
}

/* Tooltip improvements */
[title] {
    position: relative;
}

/* Make buttons more responsive */
@media (max-width: 768px) {
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .btn-group-sm .btn i {
        font-size: 0.875rem;
    }
}

/* Add subtle animation on hover */
@keyframes button-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn:hover:not(:disabled) {
    animation: button-pulse 0.3s ease-in-out;
}

/* Improve focus states for accessibility */
.btn:focus {
    outline: 2px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
}

.btn-success:focus {
    outline-color: rgba(16, 185, 129, 0.5);
}

.btn-danger:focus {
    outline-color: rgba(239, 68, 68, 0.5);
}

.btn-info:focus {
    outline-color: rgba(59, 130, 246, 0.5);
}

/* ── Financial Control Center ───────────────────────────────────────────── */
.financial-dashboard {
    --financial-ink: #172033;
    --financial-muted: #718096;
    --financial-border: #e8edf5;
    --financial-blue: #1677f2;
}

.financial-dashboard .financial-tabs {
    border: 1px solid var(--financial-border) !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06) !important;
}

.financial-dashboard .financial-tabs .nav-link {
    color: #536176;
    min-height: 42px;
    padding: 0.65rem 0.85rem;
    font-size: 0.84rem;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.financial-dashboard .financial-tabs .nav-link:hover {
    color: var(--financial-blue);
    background: #f5f8ff;
}

.financial-dashboard .financial-tabs .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #1677f2, #2563eb);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.22);
}

.financial-dashboard .financial-kpi {
    position: relative;
    min-height: 112px;
    padding: 1rem 1.15rem;
    border: 1px solid var(--financial-border);
    border-top-width: 3px !important;
    border-radius: 11px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.financial-dashboard .financial-kpi:hover {
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
    transform: translateY(-3px);
}

.financial-dashboard .financial-kpi .ims-kpi-label {
    color: #77859a;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.financial-dashboard .financial-kpi .ims-kpi-value {
    color: var(--financial-ink);
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    letter-spacing: -0.025em;
}

.financial-dashboard .financial-kpi .ims-kpi-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 0.9rem;
}

.financial-dashboard .financial-panel {
    border: 1px solid var(--financial-border) !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.055) !important;
    overflow: hidden;
}

.financial-dashboard .financial-panel .card-header {
    padding: 0.9rem 1.1rem !important;
    border-bottom-color: #edf1f6 !important;
}

.financial-dashboard .financial-panel .card-header h5 {
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.financial-dashboard .financial-panel .card-header > span {
    display: block;
    margin-top: 0.15rem;
    color: var(--financial-muted) !important;
}

.financial-dashboard .financial-quick-ops .card-body {
    padding: 1rem 1.1rem 1.15rem !important;
}

.financial-dashboard .financial-quick-ops .card-body .border {
    border-color: var(--financial-border) !important;
    background: #fbfcfe !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.financial-dashboard .financial-quick-ops .card-body .border:hover {
    border-color: #bfd5fb !important;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.1);
    transform: translateY(-3px);
}

.financial-dashboard .financial-quick-ops .display-6 {
    font-size: 2rem;
}

@media (max-width: 767.98px) {
    .financial-dashboard .financial-tabs .nav-link {
        text-align: left;
    }

    .financial-dashboard .financial-kpi {
        min-height: 106px;
    }
}

/* ============================================================
   Customer Portal Dedicated Shell (Modern, Professional & Vibrant)
   ============================================================ */
.customer-portal-layout {
    background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
    min-height: 100vh;
}

.portal-navbar {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%) !important;
    height: 64px;
    border-bottom: 1px solid rgba(37, 99, 235, 0.08);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.portal-logo-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: all 0.3s ease;
}

.portal-logo-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.portal-logo-badge i {
    color: #ffffff !important;
}

.portal-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    text-transform: uppercase;
}

.customer-portal-body {
    min-height: calc(100vh - 64px);
    display: flex;
}

.portal-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%) !important;
    border-right: 1px solid rgba(37, 99, 235, 0.1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    z-index: 1025;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-nav-menu {
    padding: 0.5rem;
}

.portal-nav-label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding: 1rem 0.75rem 0.5rem;
    margin-top: 0.25rem;
    color: #64748b;
    font-weight: 700;
}

.portal-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.portal-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #2563eb 0%, #3b82f6 100%);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.portal-nav-item i {
    flex-shrink: 0;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: all 0.2s ease;
}

.portal-nav-item:hover {
    color: #1e293b;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    transform: translateX(4px);
}

.portal-nav-item:hover i {
    color: #2563eb;
    transform: scale(1.1);
}

.portal-nav-item.active {
    color: #1e40af !important;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    border-left-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.portal-nav-item.active::before {
    transform: scaleY(1);
}

.portal-nav-item.active i {
    color: #2563eb;
    transform: scale(1.15);
}

.customer-portal-main {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-width: 0;
    flex: 1;
    padding: 1.5rem;
}

@media (max-width: 991.98px) {
    .portal-sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        width: 280px;
        height: calc(100vh - 64px);
        transform: translateX(-100%);
        z-index: 1055;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    .portal-sidebar.show {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.15);
    }
    .portal-sidebar-overlay {
        position: fixed;
        inset: 64px 0 0 0;
        background: rgba(15, 23, 42, 0.5);
        z-index: 1024;
        backdrop-filter: blur(3px);
    }
}

/* Customer Portal - Additional UI Enhancements */
.customer-portal-main .card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.customer-portal-main .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}

.customer-portal-main .table tbody tr {
    transition: all 0.2s ease;
}

.customer-portal-main .table tbody tr:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%) !important;
    transform: translateX(2px);
}

.customer-portal-main .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border: none;
    transition: all 0.3s ease;
}

.customer-portal-main .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.customer-portal-main .btn-outline-primary {
    border-color: rgba(37, 99, 235, 0.5);
    color: #2563eb;
    transition: all 0.3s ease;
}

.customer-portal-main .btn-outline-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border-color: #2563eb;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.customer-portal-main .badge {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Colorful Section Labels with Icons */
.portal-nav-label.purple-accent {
    color: #9333ea !important;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin: 0.5rem 0.25rem;
}

.portal-nav-label.green-accent {
    color: #059669 !important;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin: 0.5rem 0.25rem;
}

.portal-nav-label.yellow-accent {
    color: #d97706 !important;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin: 0.5rem 0.25rem;
}

/* Colorful Navigation Items */
.portal-nav-item.nav-purple:hover {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%) !important;
}

.portal-nav-item.nav-purple.active {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%) !important;
    color: #7e22ce !important;
}

.portal-nav-item.nav-purple.active i {
    color: #9333ea !important;
}

.portal-nav-item.nav-green:hover {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
}

.portal-nav-item.nav-green.active {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #065f46 !important;
}

.portal-nav-item.nav-green.active i {
    color: #059669 !important;
}

.portal-nav-item.nav-yellow:hover {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
}

.portal-nav-item.nav-yellow.active {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    color: #92400e !important;
}

.portal-nav-item.nav-yellow.active i {
    color: #d97706 !important;
}

/* Colorful Badges */
.badge-purple {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #7e22ce;
    border: 1px solid #d8b4fe;
}

.badge-green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #065f46;
    border: 1px solid #86efac;
}

.badge-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.badge-orange {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #9a3412;
    border: 1px solid #fdba74;
}

.badge-pink {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #9f1239;
    border: 1px solid #f9a8d4;
}

.badge-teal {
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
    color: #115e59;
    border: 1px solid #5eead4;
}

/* Colorful Status Badges */
.status-badge-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
}

.status-badge-approved {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #065f46;
    border: 1px solid #86efac;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
}

.status-badge-rejected {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
}

.status-badge-processing {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
}

.status-badge-delivered {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #7e22ce;
    border: 1px solid #d8b4fe;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
}

/* Colorful Icon Backgrounds */
.icon-bg-purple {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #9333ea;
    padding: 0.6rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-bg-green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #059669;
    padding: 0.6rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-bg-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    padding: 0.6rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-bg-orange {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #ea580c;
    padding: 0.6rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-bg-pink {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
}

/* Customer portal: restrained business palette */
.customer-portal-layout {
    --portal-primary: #1f4e79;
    --portal-primary-dark: #163a5c;
    --portal-surface: #ffffff;
    --portal-muted-surface: #f5f7fa;
    --portal-border: #d9e0e7;
    background: var(--portal-muted-surface) !important;
    color: #263238;
}

.customer-portal-layout .portal-navbar,
.customer-portal-layout .portal-sidebar,
.customer-portal-layout .customer-portal-main,
.customer-portal-layout .card,
.customer-portal-layout .dropdown-menu,
.customer-portal-layout .nav-pills {
    background: var(--portal-surface) !important;
    background-image: none !important;
    border-color: var(--portal-border) !important;
}

.customer-portal-layout .portal-navbar {
    border-bottom-color: var(--portal-border) !important;
    box-shadow: 0 1px 3px rgba(31, 78, 121, 0.08);
}

.customer-portal-layout .portal-logo-badge,
.customer-portal-layout .portal-avatar {
    background: var(--portal-primary) !important;
    box-shadow: none !important;
}

.customer-portal-layout .portal-logo-badge:hover {
    transform: none;
    box-shadow: none !important;
}

.customer-portal-layout .portal-nav-item {
    color: #4b5563;
    border-radius: 4px;
}

.customer-portal-layout .portal-nav-item::before {
    background: var(--portal-primary) !important;
}

.customer-portal-layout .portal-nav-item:hover,
.customer-portal-layout .portal-nav-item.active {
    background: #eef3f8 !important;
    color: var(--portal-primary) !important;
    box-shadow: none !important;
    transform: none;
}

.customer-portal-layout .portal-nav-item:hover i,
.customer-portal-layout .portal-nav-item.active i {
    color: var(--portal-primary) !important;
    transform: none;
}

.customer-portal-layout .customer-portal-main .btn-primary,
.customer-portal-layout .btn-primary,
.customer-portal-layout .customer-portal-main .btn-outline-primary:hover,
.customer-portal-layout .btn-outline-primary:hover {
    background: var(--portal-primary) !important;
    background-image: none !important;
    border-color: var(--portal-primary) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    transform: none;
}

.customer-portal-layout .btn-outline-primary {
    color: var(--portal-primary) !important;
    border-color: var(--portal-primary) !important;
    background: transparent !important;
    background-image: none !important;
}

.customer-portal-layout .btn:not(.btn-primary):not(.btn-outline-primary),
.customer-portal-layout .btn[style*="linear-gradient"] {
    background-image: none !important;
}

.customer-portal-layout .btn[style*="linear-gradient"] {
    background: var(--portal-primary) !important;
    border-color: var(--portal-primary) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.customer-portal-layout .customer-portal-main .table tbody tr:hover {
    background: #f8fafc !important;
    transform: none;
}

.customer-portal-layout .customer-portal-main .card:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(31, 78, 121, 0.08) !important;
}

.customer-portal-layout .icon-bg-purple,
.customer-portal-layout .icon-bg-green,
.customer-portal-layout .icon-bg-yellow,
.customer-portal-layout .icon-bg-orange,
.customer-portal-layout .icon-bg-pink,
.customer-portal-layout .icon-bg-teal,
.customer-portal-layout .badge-purple,
.customer-portal-layout .badge-green,
.customer-portal-layout .badge-yellow,
.customer-portal-layout .badge-orange,
.customer-portal-layout .badge-pink {
    background: #eef3f8 !important;
    background-image: none !important;
    border-color: var(--portal-border) !important;
    color: var(--portal-primary) !important;
}

.customer-portal-layout .customer-portal-main [style*="linear-gradient"] {
    background-image: none !important;
    background-color: var(--portal-surface) !important;
    border-color: var(--portal-border) !important;
    box-shadow: none !important;
}

.customer-portal-layout .customer-portal-main .nav-link.active {
    background: var(--portal-primary) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.customer-portal-layout .customer-portal-main .nav-link:not(.active) {
    color: #52606d !important;
}

.catalog-page .catalog-hero {
    background: #1f4e79 !important;
    background-image: none !important;
    box-shadow: none !important;
}

.catalog-page .catalog-cart-button {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #d9e0e7 !important;
    color: #1f4e79 !important;
    box-shadow: none !important;
}

.catalog-page .catalog-cart-button .small,
.catalog-page .catalog-cart-button .fs-5,
.catalog-page .catalog-cart-button i {
    color: #1f4e79 !important;
}

.catalog-page .catalog-cart-button .badge {
    background: #eef3f8 !important;
    color: #1f4e79 !important;
}

.catalog-page .catalog-add-button {
    background: #1f4e79 !important;
    background-image: none !important;
    border: 1px solid #1f4e79 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.catalog-page .catalog-add-button i {
    color: #ffffff !important;
}

.catalog-page .catalog-hero [style*="color: #ffffff"],
.catalog-page .catalog-hero [style*="color: rgba(255, 255, 255"] {
    color: #ffffff !important;
}

.catalog-page .catalog-hero .badge {
    background: #416b91 !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 1px solid #6f91ad !important;
    color: #db2777;
    padding: 0.6rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.catalog-product-grid .product-card {
    min-width: 0;
}

.catalog-product-grid .product-card .card-body {
    min-width: 0;
}

.catalog-product-grid .product-card .card-title,
.catalog-product-grid .product-card p {
    overflow-wrap: anywhere;
}

.catalog-product-grid .catalog-card-actions {
    flex-wrap: wrap;
}

.catalog-product-grid .catalog-card-actions .btn {
    min-width: 0;
    white-space: nowrap;
}

.catalog-product-grid .catalog-card-actions .catalog-add-button {
    flex: 1 1 100%;
    min-height: 38px;
}

@media (min-width: 1200px) {
    .catalog-product-grid .product-card .position-relative {
        min-height: 170px !important;
        padding: 1.25rem !important;
    }

    .catalog-product-grid .product-card .card-body {
        padding: 1rem !important;
    }
}

@media (max-width: 1199.98px) {
    .catalog-product-grid .catalog-card-actions {
        flex-direction: column;
        align-items: stretch !important;
    }

    .catalog-product-grid .catalog-card-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
/* ═══════════════════════════════════════════════════════════════════════════
   ENHANCED CUSTOMER UI - Modern Improvements
   ═══════════════════════════════════════════════════════════════════════════ */

/* Enhanced smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Improved loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Enhanced notification bell */
.notification-bell {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    transform: rotate(15deg);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Enhanced search inputs */
.enhanced-search-input {
    position: relative;
}

.enhanced-search-input input {
    padding-left: 2.5rem !important;
    border-radius: 12px !important;
    border: 2px solid transparent !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    transition: all 0.3s ease !important;
}

.enhanced-search-input input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
    transform: translateY(-1px) !important;
}

.enhanced-search-input i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1rem;
    z-index: 10;
}

/* Enhanced buttons with modern effects */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-enhanced:hover::before {
    width: 300px;
    height: 300px;
}

/* Enhanced card hover effects */
.card-enhanced {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
}

.card-enhanced::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 51, 234, 0.05) 100%);
    pointer-events: none;
}

.card-enhanced:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
}

.card-enhanced:hover::after {
    opacity: 1;
}

/* Enhanced table rows */
.table-enhanced tbody tr {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.table-enhanced tbody tr:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.03) 0%, rgba(147, 51, 234, 0.03) 100%) !important;
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Enhanced status indicators with pulsing effect */
.status-indicator {
    position: relative;
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    opacity: 0;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-indicator.active {
    background: #10b981;
}

.status-indicator.active::after {
    background: #10b981;
}

.status-indicator.pending {
    background: #f59e0b;
}

.status-indicator.pending::after {
    background: #f59e0b;
}

.status-indicator.inactive {
    background: #64748b;
}

@keyframes pulse-ring {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Enhanced tooltips */
.tooltip-enhanced {
    position: relative;
    cursor: help;
}

.tooltip-enhanced::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip-enhanced::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    transition: all 0.3s ease;
}

.tooltip-enhanced:hover::after,
.tooltip-enhanced:hover::before {
    opacity: 1;
}

/* Enhanced progress bars */
.progress-enhanced {
    height: 8px;
    border-radius: 10px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-enhanced .progress-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.progress-enhanced .progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Enhanced modal animations */
.modal-enhanced .modal-dialog {
    animation: modalSlideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced empty states */
.empty-state-enhanced {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
}

.empty-state-enhanced i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-state-enhanced h5 {
    color: #475569;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-enhanced p {
    color: #64748b;
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* Enhanced filter pills */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid transparent;
    background: white;
    color: #475569;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-pill:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateY(-1px);
}

.filter-pill.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Enhanced stat cards */
.stat-card-enhanced {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card-enhanced:hover::before {
    transform: scaleX(1);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.stat-card-trend.positive {
    background: #dcfce7;
    color: #059669;
}

.stat-card-trend.negative {
    background: #fee2e2;
    color: #dc2626;
}

/* Responsive enhancements for mobile */
@media (max-width: 767.98px) {
    .stat-card-enhanced {
        padding: 1rem;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    .card-enhanced:hover {
        transform: translateY(-2px) scale(1.005);
    }
    
    .portal-navbar {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* Accessibility improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for keyboard navigation - Enhanced */
*:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 3px;
    border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn,
    .card,
    .form-control {
        border-width: 2px !important;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Extra small utility class */
.extra-small {
    font-size: 0.75rem;
}

/* Modern gradient backgrounds */
.gradient-bg-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.gradient-bg-purple {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.gradient-bg-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-bg-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Spacing utilities */
.gap-1\.5 {
    gap: 0.375rem;
}

.gap-2\.5 {
    gap: 0.625rem;
}

.gap-3\.5 {
    gap: 0.875rem;
}

.px-2\.5 {
    padding-left: 0.625rem;
    padding-right: 0.625rem;
}

.px-3\.5 {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
}

.py-1\.5 {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

.py-2\.5 {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}

/* Letter spacing utilities */
.tracking-tight {
    letter-spacing: -0.025em;
}

.tracking-normal {
    letter-spacing: 0;
}

.tracking-wide {
    letter-spacing: 0.025em;
}

/* Line height utilities */
.lh-1 {
    line-height: 1;
}

/* Modern glassmorphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Improved hover transitions for all interactive elements */
a, button, .btn, .nav-link {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Spin animation for refresh buttons */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
