.cursor-pointer {
    cursor: pointer;
    transition: transform 0.2s;
}
.cursor-pointer:hover {
    transform: scale(1.05);
}
.cart-item-image {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1px;
    background-color: var(--mud-palette-grey-light);
}
.cart-item-image-sm {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 4px;
    background-color: var(--mud-palette-grey-light);
}
.cart-item-card {
    border-radius: 8px;
}
.cart-item-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1px;
    flex-wrap: wrap;
}
.cart-item-info {
    display: flex;
    align-items: center;
    gap: 1px;
    min-width: 120px;
    flex: 1 1 auto;
}
.cart-item-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
}
.cart-quantity-editor {
    display: flex;
    align-items: center;
    gap: 1px;
}
.cart-qty-input {
    width: 30px;
    text-align: center;
}
.cart-price-total {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-wrap: nowrap;
}
.cart-price-edit {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cart-item-subtotal,
.cart-total-display {
    min-width: 80px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}
.cart-amount {
    font-size: 1.5em;
}
.cart-currency {
    font-size: 0.85em;
    letter-spacing: 0.5px;
}
.responsive-card-width {
    width: 50%;
    flex: 0 0 auto;
}
@media (min-width: 600px) {
    .responsive-card-width {
        width: 33.33%;
    }
}
@media (min-width: 960px) {
    .responsive-card-width {
        width: 25%;
    }
}

/* Validation error highlight with jiggle animation */
@keyframes jiggle {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.field-error {
    animation: jiggle 0.4s ease-in-out;
}

.field-error .mud-input-outlined-border,
.field-invalid .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
    border-width: 2px !important;
}

.field-error .mud-input-label,
.field-invalid .mud-input-label {
    color: var(--mud-palette-error) !important;
}

/* Persistent invalid state (no animation) */
.field-invalid {
    /* Just the styling, no jiggle */
}

/* Custom notification toast */
.notification-toast {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: slideIn 0.15s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-success {
    background: #4caf50;
    color: white;
}

.notification-warning {
    background: #ff9800;
    color: white;
}

.notification-error {
    background: #f44336;
    color: white;
}

.notification-info {
    background: #2196f3;
    color: white;
}

/* Compact table styling - removes excess column spacing */
.compact-table .mud-table-container {
    overflow-x: auto;
}
.compact-table .mud-table-container > table {
    table-layout: auto;
    width: 100%;
    min-width: 800px; /* Ensure table has minimum width to trigger scroll */
}
.compact-table .mud-table-container > table td,
.compact-table .mud-table-container > table th {
    white-space: nowrap;
    padding: 6px 10px;
}

/* Global Focus Fix: Remove stuck highlight on buttons/checkboxes after click */
.mud-icon-button:focus,
.mud-button-root:not(.mud-button-filled):focus,
.mud-checkbox:focus-within .mud-button-root {
    background-color: transparent !important;
}

/* Explicit fix for Filled Icon Buttons (like TruncatedText view button) */
.mud-icon-button.mud-button-filled:focus {
    background-color: var(--mud-palette-primary) !important; /* Forces it to keep its color */
    filter: brightness(0.9); /* Slight dim to show focus but not white */
}

/* Hide tooltips on touch devices to prevent sticky tooltip issue */
@media (hover: none) and (pointer: coarse) {
    .mud-tooltip-root .mud-popover-provider,
    .mud-tooltip {
        display: none !important;
    }
}

/* Filter Grid Layout (from Transactions.razor) */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 600px) {
    .filter-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Utility Classes (from Debts.razor and others) */
.text-nowrap {
    white-space: nowrap;
}
.text-amount {
    font-weight: 600;
    font-size: 1rem;
}

/* Status Badge Classes - Transparent colored backgrounds */
.badge {
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
}
.badge-success {
    background: rgba(var(--mud-palette-success-rgb), 0.15);
    color: var(--mud-palette-success);
}
.badge-warning {
    background: rgba(var(--mud-palette-warning-rgb), 0.15);
    color: var(--mud-palette-warning);
}
.badge-error {
    background: rgba(var(--mud-palette-error-rgb), 0.15);
    color: var(--mud-palette-error);
}
.badge-info {
    background: rgba(var(--mud-palette-info-rgb), 0.15);
    color: var(--mud-palette-info);
}
.badge-primary {
    background: rgba(var(--mud-palette-primary-rgb), 0.15);
    color: var(--mud-palette-primary);
}
.badge-secondary {
    background: rgba(var(--mud-palette-secondary-rgb), 0.15);
    color: var(--mud-palette-secondary);
}

.table-footer-cell {
    border-top: 3px solid #7c4dff;
}
.table-footer-cell-bold {
    border-top: 3px solid #7c4dff;
    font-weight: bold;
}
/* Mobile Bottom Bar Adjustment */
@media (max-width: 959px) {
    header.mud-appbar {
        top: auto !important;
        bottom: 0 !important;
        position: fixed !important;
        box-shadow: 0 -3px 10px rgba(0,0,0,0.2) !important;
        border-top: 1px solid rgba(255,255,255,0.1) !important;
    }
    
    /* Remove the huge top padding (pt-16 is 64px) */
    /* Target via class only, as element tag matches div or main */
    .mud-main-content,
    .mud-main-content.pt-16 {
        padding-top: 0px !important; 
        margin-top: 0px !important;
        padding-bottom: 80px !important; /* Ensure content is visible above the bottom bar */
    }

    /* Fix Layout wrapper that might be holding space */
    .mud-layout {
        padding-top: 0px !important;
    }

    /* Fix Drawer (Menu) Top Gap */
    /* Force drawer to stick to the very top since the header is gone */
    .mud-drawer.mud-drawer-pos-left, 
    .mud-drawer.mud-drawer-pos-right {
        top: 0 !important;
        height: 100% !important;
        padding-top: 0 !important;
    }
}


.hide-skip-buttons .mud-table-pagination-actions button:first-child, .hide-skip-buttons .mud-table-pagination-actions button:last-child { display: none; }

/* RTL Fixes for Inputs */
[dir="rtl"] .mud-input-control .mud-input-slot {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .mud-input-control .mud-input-label {
    width: 50%;
    text-align: right;
    transform-origin: top right;
    right: 0;
    left: auto;
}

[dir="rtl"] .mud-input-control.mud-input-outlined-with-label .mud-input-label  {
    /* Compensate for the default left transform in LTR styles */
    transform: translate(-1px, 10px) scale(1.0); 
}

/* Compact Tabs on Mobile */
@media (max-width: 600px) {
    .compact-tabs-mobile .mud-tab {
        min-width: 56px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    /* Hide the text label - targeting MudBlazor internal structure */
    .compact-tabs-mobile .mud-tab .mud-typography {
        display: none !important;
    }
}


/* Full-width tabs: Each tab stretches equally to fill the bar */
.full-width-tabs {
    width: 100%;
}
.full-width-tabs .mud-tabs-toolbar {
    width: 100% !important;
}
.full-width-tabs .mud-tabs-toolbar-content {
    width: 100% !important;
    display: flex !important;
}
.full-width-tabs .mud-tabs-toolbar-content .mud-tab {
    flex: 1 1 0px !important;
    max-width: none !important;
    min-width: 0 !important;
}

/* Responsive Tabs: Mobile (Icons only, full width) / Desktop (Text + Icon) */
@media (max-width: 600px) {
    .responsive-tabs .mud-tabs-toolbar .mud-tabs-tabbar {
        width: 100%;
        display: flex;
    }
    
    .responsive-tabs .mud-tab {
        flex: 1 1 0px;
        min-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Hide text labels on mobile */
    .responsive-tabs .mud-tab .mud-tab-text {
        display: none !important;
    }
}



/* Hide Default Tabs Header (Used when custom AppTabs are present) */
.hide-tab-header .mud-tabs-toolbar,
.hide-tab-header .mud-tabs-tabbar,
.hide-tab-header .mud-tabs-tabbar-content {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
}

.hide-tab-header.mud-tabs {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    margin-top: 0 !important;
}

