/* InfusionPro MudBlazor Theme Overrides */

/* Light Theme Color Overrides */
:root {
    transition: background-color 0.3s ease, color 0.3s ease;

    --mud-palette-primary: #292B6A;
    --mud-palette-primary-text: #FFFFFF;
    --mud-palette-secondary: #7385A5;
    --mud-palette-secondary-text: #FFFFFF;
    --mud-palette-tertiary: #D9A456;
    --mud-palette-tertiary-text: #FFFFFF;
    --mud-palette-surface: #FFFFFF;
    --mud-palette-background: #FFFFFF;
    --mud-palette-appbar-background: #292B6A;
    --mud-palette-drawer-background: #FFFFFF;
    --mud-palette-drawer-text: #292B6A;

    /* Default MudBlazor colors */
    --mud-palette-success: #4CAF50;
    --mud-palette-warning: #FF9800;
    --mud-palette-error: #F44336;
    --mud-palette-info: #2196F3;
}

/* Dark Theme Color Overrides */
[data-theme="dark"] {
    transition: background-color 0.3s ease, color 0.3s ease;

    --mud-palette-primary: #292B6A;
    --mud-palette-primary-text: #FFFFFF;
    --mud-palette-secondary: #7385A5;
    --mud-palette-secondary-text: #FFFFFF;
    --mud-palette-tertiary: #D9A456;
    --mud-palette-tertiary-text: #FFFFFF;
    --mud-palette-surface: #16213e;
    --mud-palette-background: #1a1a2e;
    --mud-palette-appbar-background: #292B6A;
    --mud-palette-drawer-background: #16213e;
    --mud-palette-drawer-text: #FFFFFF;
}

/* Typography Overrides - InfusionPro Brand Fonts */
.mud-typography {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Headings use Playfair Display (elegant serif) */
.mud-typography-h1,
h1 {
    font-family: 'Playfair Display', serif !important;
    font-weight: 700 !important;
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
}

.mud-typography-h2,
h2 {
    font-family: 'Playfair Display', serif !important;
    font-weight: 700 !important;
    font-size: 2rem !important;
    line-height: 1.3 !important;
}

.mud-typography-h3,
h3 {
    font-family: 'Playfair Display', serif !important;
    font-weight: 600 !important;
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
}

.mud-typography-h4,
h4 {
    font-family: 'Playfair Display', serif !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    line-height: 1.4 !important;
}

.mud-typography-h5,
h5 {
    font-family: 'Playfair Display', serif !important;
    font-weight: 600 !important;
    font-size: 1.0625rem !important;
    line-height: 1.4 !important;
}

.mud-typography-h6,
h6 {
    font-family: 'Playfair Display', serif !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    line-height: 1.4 !important;
}

/* Body text uses Lato (clean sans-serif) */
.mud-typography-body1,
.mud-typography-body2,
body {
    font-family: 'Lato', sans-serif !important;
}

.mud-typography-body1 {
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
}

.mud-typography-body2 {
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
}

/* Buttons and interactive elements use Lato */
.mud-button-text {
    font-family: 'Lato', sans-serif !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
}

/* Component Specific Overrides */
.mud-button-filled-primary {
    background-color: var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary-text) !important;
}

.mud-button-filled-secondary {
    background-color: var(--mud-palette-secondary) !important;
    color: var(--mud-palette-secondary-text) !important;
}

.mud-card {
    border-radius: 8px !important;
}

.mud-paper {
    border-radius: 8px !important;
}

/* Ultra-dense list styling for tight spacing */
.mud-list-ultra-dense .mud-list-item {
    min-height: 28px !important;
    padding: 1px 4px !important;
}

.mud-list-ultra-dense .mud-list-item .mud-stack {
    margin: 0 !important;
}

.mud-list-ultra-dense .mud-list-item .mud-text {
    line-height: 1.1 !important;
}

/* Grid action menu styling - compact and centered */
.mud-menu-grid-actions .mud-menu {
    min-width: auto !important;
}

.mud-menu-grid-actions .mud-menu .mud-menu-surface {
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}




/* ==========================================
   LOGIN PAGE STYLES - Luxury Cosmetics Theme
   ========================================== */

.infusion-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #292B6A 0%, #1a1c45 50%, #7385A5 100%);
    overflow: hidden;
}

.infusion-login-background {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(217, 164, 86, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(115, 133, 165, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(217, 164, 86, 0.08) 0%, transparent 40%);
    animation: shimmer 15s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.infusion-login-container {
    position: relative;
    z-index: 1;
    padding: 2rem 1rem;
}

.infusion-login-card {
    padding: 2.5rem 2.5rem !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(217, 164, 86, 0.2);
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 40px rgba(217, 164, 86, 0.1) !important;
    transition: all 0.3s ease;
}

.infusion-login-card:hover {
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.35),
                0 0 50px rgba(217, 164, 86, 0.15) !important;
}

.infusion-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.infusion-login-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #292B6A, #7385A5);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(41, 43, 106, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.infusion-login-logo-icon {
    color: #D9A456 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.infusion-login-brand-name {
    font-size: 2.5rem;
    font-weight: 300;
    color: #292B6A;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.infusion-login-tagline {
    color: #7385A5;
    font-size: 0.9375rem;
    font-weight: 400;
    margin-bottom: 0;
    font-style: italic;
    letter-spacing: 0.3px;
}

.infusion-login-subtitle {
    font-weight: 600 !important;
    margin-top: 1rem;
    letter-spacing: 0.2px;
}

.infusion-login-form {
    margin-top: 1.5rem;
}

/* Enhanced input field styling */
.infusion-login-input .mud-input-slot {
    padding: 0 12px;
}

.infusion-login-input .mud-input-control {
    height: 44px;
    font-size: 0.9375rem;
}

.infusion-login-input .mud-input-adornment {
    color: #7385A5;
    margin-right: 8px;
}

/* Focus glow effect on inputs */
.infusion-login-input .mud-input-outlined.mud-focused {
    box-shadow: 0 0 0 3px rgba(217, 164, 86, 0.15);
}

.infusion-login-input .mud-input-outlined {
    border-color: #e5e5e5;
    transition: all 0.2s ease;
}

.infusion-login-input .mud-input-outlined:hover {
    border-color: #7385A5;
}

/* Primary submit button */
.infusion-login-submit-btn {
    height: 48px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    margin-top: 1.5rem !important;
    box-shadow: 0 4px 12px rgba(41, 43, 106, 0.25) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.infusion-login-submit-btn::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;
}

.infusion-login-submit-btn:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.infusion-login-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(41, 43, 106, 0.35) !important;
}

.infusion-login-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(41, 43, 106, 0.2) !important;
}

.infusion-login-submit-btn:disabled {
    opacity: 0.6;
}

/* Secondary forgot password button */
.infusion-login-forgot-btn {
    margin-top: 0.75rem !important;
    font-size: 0.875rem !important;
    color: #7385A5 !important;
    transition: all 0.2s ease !important;
}

.infusion-login-forgot-btn:hover:not(:disabled) {
    color: #292B6A !important;
    text-decoration: underline;
}

/* Error alert styling */
.infusion-alert-error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.08), rgba(244, 67, 54, 0.04)) !important;
    border-left: 4px solid #F44336 !important;
    border-radius: 6px !important;
    margin-bottom: 1.5rem !important;
}

.infusion-alert-error .mud-alert-message {
    color: #D32F2F !important;
    font-weight: 500;
}

.infusion-login-footer {
    margin-top: 2rem;
    text-align: center;
}

.infusion-login-footer-text {
    color: #8fa3bf !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.3px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .infusion-login-card {
        padding: 2rem 1.5rem !important;
    }

    .infusion-login-brand-name {
        font-size: 2rem;
    }

    .infusion-login-logo-container {
        width: 64px;
        height: 64px;
    }

    .infusion-login-header {
        margin-bottom: 1.5rem;
    }

    .infusion-login-form {
        margin-top: 1rem;
    }

    .infusion-login-submit-btn {
        margin-top: 1rem !important;
    }
}

/* ==========================================
   LOADING SCREEN STYLES - Luxury Theme
   ========================================== */

#app-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #292B6A 0%, #1a1c45 50%, #7385A5 100%);
    z-index: 9999;
}

.loading-background {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(217, 164, 86, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(115, 133, 165, 0.15) 0%, transparent 50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.loading-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.loading-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(217, 164, 86, 0.3);
    border-radius: 50%;
    margin-bottom: 2rem;
    animation: rotate 3s linear infinite, glow 2s ease-in-out infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(217, 164, 86, 0.4),
                    0 0 40px rgba(217, 164, 86, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(217, 164, 86, 0.6),
                    0 0 60px rgba(217, 164, 86, 0.3);
    }
}

.loading-logo-icon {
    width: 50px;
    height: 50px;
    color: #D9A456;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.loading-brand-name {
    font-size: 3rem;
    font-weight: 300;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.loading-tagline {
    color: #D9A456;
    font-size: 1rem;
    margin: 0 0 3rem 0;
    font-style: italic;
    opacity: 0.9;
}

.loading-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 2rem 0 1.5rem 0;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #D9A456, #7385A5, #D9A456);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% {
        width: 0%;
        background-position: 0% 0%;
    }
    50% {
        width: 100%;
        background-position: 100% 0%;
    }
    100% {
        width: 100%;
        background-position: 200% 0%;
        opacity: 0;
    }
}

.loading-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0;
    font-weight: 300;
}

.loading-dots {
    display: inline-block;
    width: 30px;
}

.loading-dots span {
    animation: dotPulse 1.4s infinite;
    animation-fill-mode: both;
    display: inline-block;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

.loading-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #D9A456;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 6s infinite ease-in-out;
}

.particle:nth-child(1) {
    left: 20%;
    top: 20%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    left: 80%;
    top: 30%;
    animation-delay: 1.2s;
}

.particle:nth-child(3) {
    left: 40%;
    top: 70%;
    animation-delay: 2.4s;
}

.particle:nth-child(4) {
    left: 70%;
    top: 60%;
    animation-delay: 3.6s;
}

.particle:nth-child(5) {
    left: 50%;
    top: 40%;
    animation-delay: 4.8s;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    25% {
        opacity: 0.8;
        transform: translateY(-20px) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-40px) scale(1.2);
    }
    75% {
        opacity: 0.4;
        transform: translateY(-60px) scale(0.8);
    }
}

/* ==========================================
   ACCESSIBILITY - Reduced Motion Support
   ========================================== */

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* Specifically disable decorative animations */
    .infusion-login-logo-container,
    .login-logo-container,
    .loading-logo-container,
    .particle,
    .loading-bar,
    .infusion-login-background,
    .login-background-overlay,
    .loading-background {
        animation: none !important;
    }

    /* Keep essential transitions but make them instant */
    .mud-button-root,
    .mud-input-root,
    :root,
    [data-theme="dark"] {
        transition: none !important;
    }
}

/* ==========================================
   MENU ITEM STYLES
   ========================================== */

/* Error/warning menu item styling */
.mud-menu-item-error {
    color: var(--mud-palette-error) !important;
}

.mud-menu-item-error .mud-icon-root {
    color: var(--mud-palette-error) !important;
}

.mud-menu-item-error:hover {
    background-color: rgba(var(--mud-palette-error-rgb), 0.08) !important;
}

/* ==========================================
   ULTRA-DENSE TABLE STYLES
   ========================================== */

.mud-table-ultra-dense .mud-table-row {
    height: 28px !important;
    min-height: 28px !important;
}

.mud-table-ultra-dense .mud-table-cell {
    padding: 2px 8px !important;
    font-size: 0.75rem !important;
}

.mud-table-ultra-dense .mud-chip {
    height: 18px !important;
    min-height: 18px !important;
    font-size: 0.7rem !important;
    line-height: 1 !important;
}

/* ==========================================
   TIGHT MENU STYLES
   ========================================== */

/* Ultra-specific menu item styling to match Typo.caption */
.mud-menu .mud-menu-item,
.mud-menu-item,
.mud-menu-item-root,
div.mud-menu-item,
.mud-popover .mud-menu-item {
    padding: 2px 6px !important;
    min-height: 24px !important;
    font-size: var(--mud-typography-caption-size, 0.75rem) !important;
    line-height: var(--mud-typography-caption-lineheight, 1.25) !important;
    font-family: var(--mud-typography-caption-family, var(--mud-typography-default-family, 'Inter', sans-serif)) !important;
    font-weight: var(--mud-typography-caption-weight, 400) !important;
    letter-spacing: var(--mud-typography-caption-letterspacing, 0.03333em) !important;
    color: var(--mud-palette-text-primary) !important;
}

.mud-menu .mud-menu-item .mud-icon-root,
.mud-menu-item .mud-icon-root {
    font-size: 0.8rem !important;
    margin-right: 4px !important;
    width: 16px !important;
    height: 16px !important;
}

/* Grid action menu styling - ultra-compact to match grid cells */
.mud-menu .mud-menu-item.mud-menu-item-grid-action,
.mud-menu-item.mud-menu-item-grid-action,
.mud-menu-item.mud-menu-item-grid-action.mud-menu-item-error {
    padding: 0px 10px !important;
    min-height: 14px !important;
    margin: 0px !important;
    display: flex !important;
    align-items: center !important;
}

.mud-menu-item-grid-action .mud-icon-root {
    margin-right: 4px !important;
    font-size: 1rem !important;
    width: 18px !important;
    height: 18px !important;
}

/* ==========================================
   SIGNALR STATUS IN APPBAR
   ========================================== */

/* SignalR Status in AppBar */
.appbar-signalr-status {
    display: flex;
    align-items: center;
    margin-right: 16px;  /* Space before user menu */
    margin-left: 8px;
}

.appbar-signalr-status .mud-badge-dot {
    animation: none;  /* Disable default badge animations */
}

.appbar-signalr-status .pulse-animation .mud-badge-dot {
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive: Adjust spacing on small screens */
@media (max-width: 600px) {
    .appbar-signalr-status {
        margin-right: 8px;
        margin-left: 0;
    }
}

/* ==========================================
   INFUSIONPRO GENERAL COMPONENT STYLES
   ========================================== */

/* InfusionPro Card Styling */
.infusion-card {
    border-radius: 8px !important;
    transition: all 0.3s ease;
    border: 1px solid rgba(217, 164, 86, 0.1);
}

.infusion-card:hover {
    border-color: rgba(217, 164, 86, 0.3);
    box-shadow: 0 4px 12px rgba(41, 43, 106, 0.12) !important;
}

/* InfusionPro Card Header */
.infusion-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* InfusionPro Button Styles */
.infusion-btn-primary {
    background-color: #292B6A !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.infusion-btn-primary:hover:not(:disabled) {
    background-color: #1a1c45 !important;
    box-shadow: 0 4px 8px rgba(41, 43, 106, 0.25) !important;
    transform: translateY(-1px);
}

.infusion-btn-secondary {
    border-color: #7385A5 !important;
    color: #7385A5 !important;
    font-weight: 500 !important;
}

.infusion-btn-secondary:hover:not(:disabled) {
    background-color: rgba(115, 133, 165, 0.08) !important;
    border-color: #292B6A !important;
    color: #292B6A !important;
}

.infusion-btn-gold {
    background-color: #D9A456 !important;
    color: #ffffff !important;
    font-weight: 500 !important;
}

.infusion-btn-gold:hover:not(:disabled) {
    background-color: #c79345 !important;
    box-shadow: 0 4px 8px rgba(217, 164, 86, 0.25) !important;
}

/* InfusionPro Input Styles */
.infusion-input .mud-input-outlined,
.infusion-select .mud-input-outlined {
    border-color: #e5e5e5;
    transition: all 0.2s ease;
}

.infusion-input .mud-input-outlined:hover,
.infusion-select .mud-input-outlined:hover {
    border-color: #7385A5;
}

.infusion-input .mud-input-outlined.mud-focused,
.infusion-select .mud-input-outlined.mud-focused {
    border-color: #D9A456 !important;
    box-shadow: 0 0 0 3px rgba(217, 164, 86, 0.15);
}

/* Tighter Input Spacing for Forms */
.infusion-input .mud-input-root,
.infusion-select .mud-input-root {
    margin-bottom: 0 !important;
}

.infusion-input .mud-input-control,
.infusion-select .mud-input-control {
    padding: 10px 12px !important;
}

.infusion-input .mud-input-helper-text,
.infusion-select .mud-input-helper-text {
    margin-top: 2px !important;
    margin-bottom: 0 !important;
}

/* Section Header Styling */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sticky Bottom Action Bar */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mud-palette-surface);
    border-top: 1px solid rgba(115, 133, 165, 0.2);
    padding: 16px 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Dark mode support for sticky action bar */
@media (prefers-color-scheme: dark) {
    .sticky-action-bar {
        background: var(--mud-palette-surface);
        border-top: 1px solid rgba(115, 133, 165, 0.3);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Page bottom padding to prevent content being hidden by sticky bar */
.create-raw-material-page {
    padding-bottom: 100px;
}

/* ==========================================
   DASHBOARD PAGE STYLES
   ========================================== */

.infusion-dashboard {
    min-height: calc(100vh - 64px);
    padding-bottom: 32px;
}

/* Dashboard Header */
.dashboard-header {
    padding: 24px;
    background: linear-gradient(135deg, rgba(41, 43, 106, 0.03) 0%, rgba(115, 133, 165, 0.03) 100%);
    border-radius: 8px;
    border-left: 4px solid #D9A456;
}

.dashboard-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

@media (max-width: 768px) {
    .dashboard-header .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Dashboard Metrics Cards */
.dashboard-metrics {
    margin-bottom: 24px;
}

.metric-card {
    height: 100%;
    border: 1px solid rgba(217, 164, 86, 0.1);
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: rgba(217, 164, 86, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(41, 43, 106, 0.15) !important;
}

.metric-value {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    color: #D9A456 !important;
    margin: 16px 0 8px 0;
    line-height: 1;
}

.metric-label {
    color: #7385A5 !important;
    font-size: 0.875rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Compact Entity Metric Cards - Tertiary accent on TOP edge */
.entity-metric-card {
    border-top: 3px solid var(--mud-palette-tertiary);
    background: var(--mud-palette-surface);
    transition: all 0.2s ease;
}

.entity-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(217, 164, 86, 0.15) !important;
}

.entity-metric-content {
    padding: 8px 12px !important;
    text-align: center;
}

.entity-metric-label {
    color: #7385A5;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.entity-metric-value {
    color: #292B6A;
    font-weight: 600;
    line-height: 1.2;
}

.entity-metrics-grid {
    margin-bottom: 24px;
}

/* Dark mode support for entity metric cards */
@media (prefers-color-scheme: dark) {
    .entity-metric-card {
        border-top-color: #D9A456;
        background: var(--mud-palette-surface);
    }

    .entity-metric-card:hover {
        box-shadow: 0 4px 8px rgba(229, 184, 117, 0.2) !important;
    }

    .entity-metric-label {
        color: #8fa3bf;
    }

    .entity-metric-value {
        color: #4d51a3;
    }
}

/* ==========================================
   DATA GRID STYLES
   ========================================== */

.infusion-grid {
    border-radius: 8px;
    width: 100%;
    table-layout: fixed;
}

.infusion-grid .mud-table-container {
    overflow-x: auto;
    max-width: 100%;
}

.infusion-grid .mud-table {
    table-layout: fixed;
    width: 100%;
}

.infusion-grid .mud-table-head {
    background-color: rgba(41, 43, 106, 0.03);
}

.infusion-grid .mud-table-head .mud-th {
    font-weight: 600;
    color: #292B6A;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.infusion-grid .mud-table-row:hover {
    background-color: rgba(217, 164, 86, 0.05) !important;
    cursor: pointer;
}

.infusion-grid .mud-table-cell {
    padding: 2px 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8125rem;
    max-width: 0;
}

/* ── Outstanding Materials grid — job order detail (INF-218) ───────────────
   A mixed bulk ingredient adds a whole extra tier of rows, so this grid has to stay
   tight enough that the dialog does not outgrow the viewport. */
.infusion-materials-table .mud-table-cell {
    padding: 1px 8px !important;
    line-height: 1.4;
}

/* The chip is the tallest thing in a row, so it alone sets the row height. Packaging fits
   two chips in this cell — the type and its Primary/Secondary/Shipper refinement — so both
   are kept small enough to stay on one line. */
.infusion-materials-table .mud-chip {
    height: 18px !important;
    min-height: 18px !important;
    font-size: 0.625rem !important;
    padding: 0 6px !important;
    margin: 0 !important;
}

.infusion-materials-table .material-type-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

/* Subordinate to the type chip beside it, not a peer. */
.infusion-materials-table .material-subtype-chip {
    opacity: 0.8;
    font-weight: 400 !important;
}

/* Widened over the shared 12% to seat both packaging chips without wrapping. */
.infusion-materials-table .grid-col-category {
    width: 16%;
    min-width: 175px;
}

/* Material name: branch icon, code and name on one line, truncating the name only. */
.infusion-materials-table .material-name-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.infusion-materials-table .material-name-cell .mud-typography {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.infusion-materials-table .material-branch-icon {
    flex-shrink: 0;
    font-size: 1rem !important;
}

.infusion-materials-table .material-code {
    flex-shrink: 0;
}

/* Depth reads as the cascade: 0 the finished good being made and the packaging,
   1 the bulk it is filled from, 2 that bulk's raw materials and ingredients,
   3 the raw materials behind an ingredient mixed bulk. Every tier gained a level
   when finished goods took the head of the tree (INF-228). */
.infusion-materials-table .material-depth-1 { padding-left: 1.25rem; }
.infusion-materials-table .material-depth-2 { padding-left: 2.5rem; }
.infusion-materials-table .material-depth-3 { padding-left: 3.75rem; }

/* Column width classes for specific sizing */
.infusion-grid .grid-col-actions {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

.infusion-grid .grid-col-status {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

.infusion-grid .grid-col-allergens {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    text-align: center;
}

.infusion-grid .grid-col-code-status {
    width: 12%;
    min-width: 120px;
}

.infusion-grid .grid-col-icon {
    width: 10%;
    min-width: 100px;
}

.infusion-grid .grid-col-code {
    width: 11%;
    min-width: 110px;
}

.infusion-grid .grid-col-cas {
    width: 10%;
    min-width: 100px;
}

.infusion-grid .grid-col-category {
    width: 12%;
    min-width: 120px;
}

.infusion-grid .grid-col-stock-right {
    width: 13%;
    min-width: 130px;
    text-align: right;
}

.infusion-grid .grid-col-narrow {
    width: 10%;
    min-width: 100px;
}

.infusion-grid .grid-col-medium {
    width: 15%;
    min-width: 150px;
}

.infusion-grid .grid-col-wide {
    width: 25%;
    min-width: 200px;
}

.infusion-grid .grid-col-version {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.infusion-grid .grid-col-formula-status {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

.infusion-grid .grid-col-cost-right {
    width: 120px;
    min-width: 120px;
    text-align: right;
}

.infusion-grid .grid-col-qty-right {
    width: 130px;
    min-width: 130px;
    text-align: right;
}

/* Allergen Entry Grid - Prevent Overflow */
.allergen-entry-grid {
    overflow-x: auto;
    width: 100%;
}

.allergen-entry-grid .mud-table-cell {
    padding: 8px 12px !important;
}

/* Compact chips in grids */
.infusion-grid .mud-chip {
    height: 20px !important;
    padding: 0 6px !important;
    font-size: 0.6875rem !important;
    line-height: 20px !important;
}

.infusion-grid .mud-chip .mud-chip-content {
    padding: 0 !important;
}

.infusion-grid .mud-chip .mud-chip-text {
    font-size: 0.6875rem !important;
    line-height: 1 !important;
}

/* Stock Status Chips */
.stock-status-in {
    background-color: rgba(217, 164, 86, 0.1) !important;
    color: #D9A456 !important;
    font-weight: 500 !important;
}

.stock-status-low {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #f59e0b !important;
    font-weight: 500 !important;
}

.stock-status-out {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    font-weight: 500 !important;
}

/* ==========================================
   INDUSTRY-SPECIFIC COMPONENTS
   ========================================== */

/* Batch Badge */
.batch-badge {
    background: linear-gradient(135deg, #292B6A, #7385A5) !important;
    color: #D9A456 !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
}

/* Allergen Tags */
.allergen-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.allergen-tag {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
}

/* Expiry Warning */
.expiry-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.04)) !important;
    border-left: 4px solid #f59e0b !important;
    border-radius: 4px !important;
}

/* Scent Category Badges */
.scent-category {
    font-weight: 500 !important;
    border-radius: 4px !important;
}

.scent-floral {
    background-color: rgba(236, 72, 153, 0.1) !important;
    color: #ec4899 !important;
}

.scent-woody {
    background-color: rgba(161, 98, 7, 0.1) !important;
    color: #a16207 !important;
}

.scent-citrus {
    background-color: rgba(234, 179, 8, 0.1) !important;
    color: #eab308 !important;
}

.scent-oriental {
    background-color: rgba(168, 85, 247, 0.1) !important;
    color: #a855f7 !important;
}

.scent-fresh {
    background-color: rgba(34, 197, 94, 0.1) !important;
    color: #22c55e !important;
}

/* ==========================================
   RESPONSIVE UTILITIES
   ========================================== */

@media (max-width: 960px) {
    .dashboard-header {
        padding: 16px;
    }

    .metric-value {
        font-size: 2rem !important;
    }

    .infusion-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .dashboard-header .header-content {
        flex-direction: column;
        gap: 12px;
    }

    .metric-value {
        font-size: 1.75rem !important;
    }

    .dashboard-metrics {
        gap: 12px !important;
    }
}

/* ==========================================
   CHECKLIST SIGNATURE BADGE
   ========================================== */

/* Marks a checklist item that prompts for a PIN before it can be ticked.
   Shared by Bulk Mixing, Prepare for Filling and Filling so the three phases
   flag a signature item identically (INF-234). */
.checklist-signature-icon {
    vertical-align: middle;
}

/* ==========================================
   GOLD BUTTON STYLES
   ========================================== */

/* Gold button - normal and disabled states */
.gold-button {
    background-color: #D9A456 !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.gold-button:hover:not(:disabled) {
    background-color: #c79345 !important;
    box-shadow: 0 4px 8px rgba(217, 164, 86, 0.25) !important;
    transform: translateY(-1px);
}

.gold-button:disabled {
    background-color: #e5d4b8 !important;
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 0.8 !important;
    cursor: not-allowed !important;
}

/* ==========================================
   GLASS EFFECT CHIPS (MUDBLAZOR PATTERN)
   ========================================== */

/* Glass effect chips - lighter, see-through with clear border
   This is the default pattern for all status indicators (Active/Inactive)
   Use Variant="Variant.Text" on MudChip to enable this styling */

.mud-chip.mud-chip-text {
    background-color: transparent !important;
    border: 1px solid currentColor !important;
    border-radius: 16px !important;
    backdrop-filter: blur(4px);
    font-weight: 500 !important;
}

/* Status chip - Active state (Success color) */
.mud-chip.mud-chip-text.mud-chip-color-success {
    color: #4CAF50 !important;
    border-color: rgba(76, 175, 80, 0.5) !important;
    background-color: rgba(76, 175, 80, 0.08) !important;
}

/* Status chip - Inactive state (Default color) */
.mud-chip.mud-chip-text.mud-chip-color-default {
    color: #9e9e9e !important;
    border-color: rgba(158, 158, 158, 0.5) !important;
    background-color: rgba(158, 158, 158, 0.08) !important;
}

/* Status chip - Warning state (Warning color) */
.mud-chip.mud-chip-text.mud-chip-color-warning {
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    background-color: rgba(245, 158, 11, 0.08) !important;
}

/* Status chip - Info state (Info color) */
.mud-chip.mud-chip-text.mud-chip-color-info {
    color: #2196F3 !important;
    border-color: rgba(33, 150, 243, 0.5) !important;
    background-color: rgba(33, 150, 243, 0.08) !important;
}

/* Status chip - Error state (Error color) */
.mud-chip.mud-chip-text.mud-chip-color-error {
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    background-color: rgba(239, 68, 68, 0.08) !important;
}

/* Fix text alignment in status chips - center vertically */
.mud-chip.status-chip .mud-chip-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding: 0 8px !important;
}

/* Dark mode support for glass effect chips */
@media (prefers-color-scheme: dark) {
    .mud-chip.mud-chip-text.mud-chip-color-success {
        color: #66BB6A !important;
        border-color: rgba(102, 187, 106, 0.6) !important;
        background-color: rgba(102, 187, 106, 0.12) !important;
    }

    .mud-chip.mud-chip-text.mud-chip-color-default {
        color: #bdbdbd !important;
        border-color: rgba(189, 189, 189, 0.6) !important;
        background-color: rgba(189, 189, 189, 0.12) !important;
    }

    .mud-chip.mud-chip-text.mud-chip-color-warning {
        color: #fbbf24 !important;
        border-color: rgba(251, 191, 36, 0.6) !important;
        background-color: rgba(251, 191, 36, 0.12) !important;
    }

    .mud-chip.mud-chip-text.mud-chip-color-info {
        color: #64B5F6 !important;
        border-color: rgba(100, 181, 246, 0.6) !important;
        background-color: rgba(100, 181, 246, 0.12) !important;
    }

    .mud-chip.mud-chip-text.mud-chip-color-error {
        color: #f87171 !important;
        border-color: rgba(248, 113, 113, 0.6) !important;
        background-color: rgba(248, 113, 113, 0.12) !important;
    }
}

/* ==========================================
   INACTIVE ROW STYLING (DATAGRID)
   ========================================== */

/* Inactive rows appear dull - reduced opacity and muted colors */
.infusion-grid .mud-table-row.grid-row-inactive {
    opacity: 0.5 !important;
    background-color: rgba(158, 158, 158, 0.03) !important;
}

.infusion-grid .mud-table-row.grid-row-inactive:hover {
    opacity: 0.6 !important;
    background-color: rgba(158, 158, 158, 0.08) !important;
}

/* Inactive row text color - more muted */
.infusion-grid .mud-table-row.grid-row-inactive .mud-typography {
    color: #9e9e9e !important;
}

.infusion-grid .mud-table-row.grid-row-inactive .mud-text {
    color: #9e9e9e !important;
}

/* Dark mode support for inactive rows */
@media (prefers-color-scheme: dark) {
    .infusion-grid .mud-table-row.grid-row-inactive {
        opacity: 0.4 !important;
        background-color: rgba(189, 189, 189, 0.05) !important;
    }

    .infusion-grid .mud-table-row.grid-row-inactive:hover {
        opacity: 0.5 !important;
        background-color: rgba(189, 189, 189, 0.08) !important;
    }

    .infusion-grid .mud-table-row.grid-row-inactive .mud-typography,
    .infusion-grid .mud-table-row.grid-row-inactive .mud-text {
        color: #757575 !important;
    }
}

/* ==========================================
   STICKY ACTION BAR - Edit Pages
   ========================================== */

/* Sticky footer for Edit pages (Supplier, RawMaterial, etc.) */
.sticky-edit-supplier-footer,
.sticky-edit-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mud-palette-surface);
    border-top: 1px solid rgba(115, 133, 165, 0.15);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    z-index: 100;
    margin-top: 16px;
    width: 100%;
}

/* Ensure content inside sticky footer is visible */
.sticky-edit-supplier-footer .mud-card-content,
.sticky-edit-footer .mud-card-content {
    display: block;
}

/* Ensure required fields text doesn't get hidden */
.sticky-edit-supplier-footer .mud-typography,
.sticky-edit-footer .mud-typography {
    white-space: nowrap;
    min-width: fit-content;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sticky-edit-supplier-footer,
    .sticky-edit-footer {
        background: var(--mud-palette-surface);
        border-top-color: rgba(115, 133, 165, 0.25);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    }
}

/* ==========================================
   CONTACT ROLES CHECKBOX GROUP
   ========================================== */

/* Extra tight spacing for Contact Roles checkboxes */
.contact-roles-group .mud-checkbox {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 28px;
}

.contact-roles-group .mud-checkbox .mud-checkbox-content {
    margin: 0 !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

.contact-roles-group .mud-checkbox .mud-button-root {
    padding: 4px !important;
}

/* ==========================================
   GLOBAL GLASS EFFECT MUDCHIPS
   ========================================== */

/* Glass effect for all MudChips - ensures content is centered */
.mud-chip {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    font-weight: 500 !important;
}

/* Ensure chip content is centered horizontally and vertically */
.mud-chip-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    text-align: center !important;
}

/* Glass effect variants for different colors - text color matches border */
.mud-chip.mud-chip-color-success {
    color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.08) !important;
    border-color: rgba(76, 175, 80, 0.5) !important;
}

.mud-chip.mud-chip-color-warning {
    color: #FF9800 !important;
    background: rgba(255, 152, 0, 0.08) !important;
    border-color: rgba(255, 152, 0, 0.5) !important;
}

.mud-chip.mud-chip-color-error {
    color: #F44336 !important;
    background: rgba(244, 67, 54, 0.08) !important;
    border-color: rgba(244, 67, 54, 0.5) !important;
}

.mud-chip.mud-chip-color-info {
    color: #2196F3 !important;
    background: rgba(33, 150, 243, 0.08) !important;
    border-color: rgba(33, 150, 243, 0.5) !important;
}

.mud-chip.mud-chip-color-primary {
    color: #292B6A !important;
    background: rgba(41, 43, 106, 0.08) !important;
    border-color: rgba(41, 43, 106, 0.5) !important;
}

.mud-chip.mud-chip-color-secondary {
    color: #7385A5 !important;
    background: rgba(115, 133, 165, 0.08) !important;
    border-color: rgba(115, 133, 165, 0.5) !important;
}

.mud-chip.mud-chip-color-tertiary {
    color: #D9A456 !important;
    background: rgba(217, 164, 86, 0.08) !important;
    border-color: rgba(217, 164, 86, 0.5) !important;
}

.mud-chip.mud-chip-color-default {
    color: #9e9e9e !important;
    background: rgba(158, 158, 158, 0.08) !important;
    border-color: rgba(158, 158, 158, 0.5) !important;
}
/* ============================================================
   Session Warning Snackbar — glass effect, centered, 50% wide

   Scoped to the snackbar's own CustomClass, NOT to its position container.
   Keying these off .mud-snackbar-location-top-center meant that making
   top-center the global default position handed this treatment to every
   success/warning/error/info toast on the site.
   ============================================================ */

/* Pinned to the top of the viewport, clear of the bottom-centre stack ordinary toasts use. */
.mud-snackbar.session-warning-snackbar {
    position: fixed !important;
    top: 24px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 70vw !important;
    min-width: 480px !important;
    max-width: 900px !important;
    /* Glass: transparent dark navy + blur */
    background: rgba(20, 22, 60, 0.55) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(217, 164, 86, 0.5) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    color: #f0f1fa !important;
}

/* Kill the solid MudAlert background colour */
.mud-snackbar.session-warning-snackbar.mud-alert,
.mud-snackbar.session-warning-snackbar.mud-alert-filled-warning {
    background-color: transparent !important;
    background: rgba(20, 22, 60, 0.55) !important;
}

/* Message text */
.mud-snackbar.session-warning-snackbar .mud-snackbar-content-message {
    color: #f0f1fa !important;
    font-size: 0.95rem !important;
}

/* Warning icon */
.mud-snackbar.session-warning-snackbar .mud-icon-root {
    color: #D9A456 !important;
}

/* Flex row so button doesn't stretch */
.mud-snackbar.session-warning-snackbar .mud-snackbar-content {
    align-items: center !important;
    flex-wrap: nowrap !important;
}

/* Action button — standard height, single line */
.mud-snackbar.session-warning-snackbar .mud-button-root,
.mud-snackbar.session-warning-snackbar button.mud-button-root {
    align-self: center !important;
    height: 36px !important;
    max-height: 36px !important;
    min-height: 36px !important;
    line-height: 36px !important;
    padding: 0 16px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-color: rgba(217, 164, 86, 0.65) !important;
    color: #D9A456 !important;
}

/* Full-screen "working" overlay — darker/blurred scrim behind an elevated card
   instead of bare spinner+text floating on a barely-dimmed background. */
.infusion-loading-overlay .mud-overlay-scrim {
    background-color: rgba(26, 28, 69, 0.75) !important;
    border-color: rgba(26, 28, 69, 0.75) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Same card, inline within the page instead of over a dark scrim — used for
   initial page/data loads where there's no existing content behind it to dim. */
.infusion-busy-inline {
    display: flex;
    justify-content: center;
    padding: 64px 16px;
}

.infusion-loading-overlay-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 56px;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.infusion-loading-overlay-title {
    color: #292B6A;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
}

.infusion-loading-overlay-subtitle {
    color: #5a6a85;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .infusion-loading-overlay-card {
        background: #23254a;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    }

    .infusion-loading-overlay-title {
        color: #e8e9f3;
    }

    .infusion-loading-overlay-subtitle {
        color: #a8bbcc;
    }
}

/* ==========================================
   PRODUCTION PHASE SCREENS
   ========================================== */

/* Bulk Mixing, Prepare for Filling and Filling Queue are one shop-floor flow
   wearing three names. They carried these rules as three near-identical page
   <style> blocks under two prefixes until INF-251 gave them one home. The names
   are phase-neutral on purpose: a rule that has to be renamed to be reused gets
   copied instead, which is how the two prefixes came about. */

/* Tablet-first: large touch targets. Unscoped, because the shared PIN dialog
   renders outside the page container. */
.production-btn {
    min-height: 56px !important;
    font-size: 18px !important;
    letter-spacing: 0.03em;
}

/* These two are scoped to .production-phase, the class each of the three pages
   puts on its container. As page-level <style> they were global, so every
   MudBlazor checkbox and table in the application was restyled for as long as
   one of these screens stayed mounted (INF-251). */
.production-phase .mud-checkbox .mud-icon-root {
    font-size: 32px !important;
}

.production-phase .mud-table-cell {
    padding: 12px 16px !important;
    font-size: 15px;
}

/* Step indicator */
.production-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.production-step-dot-active {
    background: #292B6A;
    color: #fff;
}

.production-step-dot-done {
    background: #43a047;
    color: #fff;
}

.production-step-dot-pending {
    background: #E0E0E0;
    color: #666;
}

/* Bulk Mixing nests a per-batch indicator inside the page-level one. */
.production-step-dot-sm {
    width: 22px;
    height: 22px;
    font-size: 11px;
}

.production-step-connector {
    flex: 1;
    height: 2px;
    background: #E0E0E0;
    max-width: 40px;
}

/* Bulk Mixing's nested per-batch indicator, alongside .production-step-dot-sm. */
.production-step-connector-sm {
    max-width: 24px;
}

/* Worker sign-off (INF-235; every phase since INF-251) - a PIN is a handful of
   digits, not prose, so the field is sized to its content and sits beside the
   worker's name instead of spanning the card at textarea height. Pending and
   signed-off rows share one shape so the screen does not collapse under each
   person as they sign. */
.production-signoff-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    min-height: 76px;
}

.production-signoff-identity {
    flex: 1 1 auto;
    min-width: 0;
}

.production-signoff-name {
    font-size: 18px;
    font-weight: 700;
}

.production-pin {
    flex: 0 0 160px;
    width: 160px;
    margin: 0;
}

.production-pin .mud-input-slot {
    min-height: 56px;
    font-size: 22px;
    letter-spacing: 0.3em;
    /* offsets the trailing gap letter-spacing leaves after the last digit */
    text-indent: 0.3em;
    text-align: center;
}

.production-signoff-btn {
    min-width: 132px;
    min-height: 56px !important;
    font-size: 16px !important;
}

/* Flex behaviour belongs to the row, not to the button - the signature dialog
   reuses this size with no row around it. */
.production-signoff-row .production-signoff-btn {
    flex: 0 0 auto;
}

/* Checklist signature dialog. The statement is the content: a worker is putting
   their name to it, so it is set like something signed rather than as a subtitle
   under a heading that repeated the dialog's own title bar (INF-251). */
.pin-dialog-statement {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    line-height: 1.45;
    color: var(--mud-palette-primary);
    border-left: 3px solid var(--mud-palette-tertiary);
    padding: 2px 0 2px 16px;
    margin: 4px 0 24px;
}

.pin-dialog-signer {
    text-align: center;
    font-size: 14px;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 8px;
}

.pin-dialog-signer strong {
    color: var(--mud-palette-text-primary);
    font-weight: 700;
}

/* Sized to a PIN and centred. The sign-off row's extra slot height made this read
   as an empty square once it stood on its own in a dialog, so the control keeps
   the outlined variant's natural height - still a comfortable tablet target. */
.pin-dialog-field {
    width: 200px;
    margin: 0 auto;
}

.pin-dialog-field .mud-input-slot {
    font-size: 26px;
    letter-spacing: 0.5em;
    /* offsets the trailing gap letter-spacing leaves after the last digit */
    text-indent: 0.5em;
    text-align: center;
}

/* Phone - the row stacks, and a full-width action is the right call once it does. */
@media (max-width: 599px) {
    .production-signoff-row {
        flex-wrap: wrap;
    }

    .production-pin {
        flex: 1 1 140px;
        width: auto;
    }

    .production-signoff-row .production-signoff-btn {
        flex: 1 1 100%;
    }
}

/* ==========================================
   PRODUCTION QUEUE DASHBOARD
   ========================================== */

/* Column header on the drag-and-drop tabs. A draggable tab cannot use MudTable -
   its rows are MudPaper inside a MudDropContainer - so this header is hand-rolled,
   and it has to reproduce the table head's treatment or the tab reads as a flat
   grey band beside the read-only tabs that do use one (INF-259).

   Padding stays with the markup's pa-2 on purpose: header cells and row cells carry
   identical width/flex values, so changing one side alone breaks column alignment. */
.queue-header {
    margin-top: 12px;
    border-radius: 4px 4px 0 0;
    /* The gold rule is what stops it reading flat. Borrowed from .entity-metric-card,
       which uses the same accent to give a plain panel an edge. A hairline in the table
       line colour is not enough here: these rows are detached cards on a light ground,
       not a continuous table surface, so the head has nothing to sit flush against. */
    border-bottom: 2px solid var(--mud-palette-tertiary);
}

/* Weight and colour only. Size deliberately stays at caption: the Stage Time column is
   a fixed 70px and the label wraps to two lines at anything larger. */
.queue-header .mud-typography-caption {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

/* App bar identity (INF-258).

   A dropper-and-flask mark, then the name. Perfume Producers' own logo was tried here beside it and
   dropped — the file is still in wwwroot/img, and is the right thing to put on outward-facing
   documents (purchase orders, delivery notes) where the business is the sender rather than the
   software.

   !important on the type properties is not habit: the brand type scale at the top of this file sets
   `.mud-typography-h6, h6` with !important on font-family, font-weight, font-size and line-height,
   so specificity alone loses to it. If that block ever drops its !important, drop these too. */
.mud-appbar-mark {
    display: block;
    height: 26px;
    width: auto;
    /* The artwork already carries about 3px of its own clearance at this height — the flask stops
       short of the viewBox edge — so the margin only has to top that up, not supply the whole gap. */
    margin-right: 2px;
}

.mud-appbar-custom .mud-appbar-brand {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.85);
}

.mud-appbar-custom .mud-appbar-brand-pro {
    /* Caps come from CSS, not the markup, so the DOM still says "InfusionPro" to a screen reader
       and to anyone copying it. */
    text-transform: uppercase;
    font-family: inherit;
    font-size: 1em;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: var(--mud-palette-tertiary, #D9A456);
    /* A hair of air, no more. The weight break is the join; a gap would undo it. */
    margin-left: 0.06em;
}

.mud-appbar-identity {
    align-items: center;
}

.mud-appbar-version {
    margin-left: 9px;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.4);
    /* Not a link and not editable — the arrow says so, and the tooltip does the rest. */
    cursor: default;
    transition: color 120ms ease;
}

.mud-appbar-version:hover {
    color: rgba(255, 255, 255, 0.75);
}

/* Narrow screens keep the leading logo and shed everything after it — the bar still has the drawer
   toggle, the SignalR indicator and the user menu to carry. */
@media (max-width: 760px) {
    .mud-appbar-mark {
        height: 22px;
    }

    .mud-appbar-custom .mud-appbar-brand,
    .mud-appbar-version {
        display: none;
    }
}

/* Drawer header. "Navigation" labels a navigation drawer, so it is saying something the reader can
   already see — it should sit quietly and let the links carry the panel. Matching the app bar
   height keeps it on the same horizontal band as the logo. */
.mud-drawer-header-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--mud-appbar-height, 64px);
    padding-top: 0;
    padding-bottom: 0;
}

.mud-drawer-header-custom .mud-typography {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------------
   Grid figure + code text (INF-268)
   The material list pages set these with inline style attributes, which Razor
   pages in this project are not supposed to carry. Same rendering, one place.
   --------------------------------------------------------------------------- */

.infusion-grid .grid-code-text {
    font-family: monospace;
    font-weight: 500;
}

.infusion-grid .grid-figure {
    font-family: monospace;
}

.infusion-grid .grid-header-right {
    text-align: right;
    width: 100%;
}

/* Gold rule under a card's section heading. The detail pages set this with an inline
   style attribute; same rendering, in one place (INF-268). */
.section-header-accent {
    border-bottom: 3px solid var(--mud-palette-tertiary);
    padding-bottom: 12px;
}

/* Imports: the problem count in a staged file's subtitle. Error-coloured inline rather than as a
   separate element, so "34 rows · 3 with problems" reads as one sentence (INF-277). */
.import-detail-problems {
    color: var(--mud-palette-error);
    font-weight: 600;
}

/* Imports: the history's status chip. Fixed and narrow — the widest label it ever holds is
   "Partly imported", and left to size itself the column took slack the Notes column needed. */
.infusion-grid .grid-col-import-status {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}

/* Imports: the whole-file actions above a staged file's rows. A padded strip of its own rather than
   a card body wrapping the grid, so the grid still runs to the card's edges the way every other list
   in the app does (INF-277). */
.import-detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* Gross profit breakdown: rows that open onto what they are made of (INF-318). */
.profit-tree .profit-tree-row {
    cursor: pointer;
}

.profit-tree .profit-tree-chevron {
    display: inline-block;
    width: 22px;
    vertical-align: middle;
}

/* Product page: the picture customers see in the portal (INF-121). */
.product-picture-frame {
    aspect-ratio: 4 / 3;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: #f3f1ec;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-picture-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
