@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: var(--app-font-family, 'Cairo'), 'Tajawal', 'Almarai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    background-color: #f4f6f8; /* Soft light grey for enterprise platforms */
    min-height: 100vh;
    margin: 0;
    color: #111827;
}

/* Enterprise Clean Card */
.enterprise-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    transition: box-shadow 0.2s ease-in-out;
}

.enterprise-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* Subtle Inputs */
.mud-input-control > .mud-input-control-input-container > .mud-input {
    background-color: #ffffff !important;
    border-radius: 6px !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.mud-input-control > .mud-input-control-input-container > .mud-input:focus-within {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important; /* Soft blue focus ring */
}

/* Primary Button */
.enterprise-btn {
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-weight: 500 !important;
    text-transform: none !important; /* Keep casing natural */
    letter-spacing: normal !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.mud-appbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    color: #1f2937 !important;
}

.mud-drawer {
    background: #ffffff !important;
    border-right: 1px solid #e5e7eb !important;
}

/* ═══════════════════════════════════════════════════════════════
   Enterprise ERP Sidebar Navigation (MudNavMenu & MudNavGroup)
   Single-line headers, subtle tinted backgrounds & visual hierarchy
   ═══════════════════════════════════════════════════════════════ */

.mud-navmenu {
    padding: 6px 4px !important;
}

/* Root Dashboard link */
.mud-navmenu > .mud-nav-link {
    margin: 3px 6px !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    transition: all 0.2s ease-in-out !important;
    white-space: nowrap !important;
}

/* Module Group Header (The expandable button) */
.mud-nav-group > button.mud-nav-link,
.mud-nav-group > .mud-nav-link {
    margin: 4px 6px !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    background-color: #f8fafc !important; /* Soft, clean, ultra-light slate tint */
    border: 1px solid #eef2f6 !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    color: #334155 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    min-height: 40px !important;
}

/* Hover state on module group header */
.mud-nav-group > button.mud-nav-link:hover,
.mud-nav-group > .mud-nav-link:hover {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* When Module is Open (Expanded) */
.mud-nav-group.mud-nav-group-open > button.mud-nav-link,
.mud-nav-group.mud-nav-group-open > .mud-nav-link {
    background-color: rgba(30, 58, 138, 0.06) !important; /* Elegant primary tint */
    border-color: rgba(30, 58, 138, 0.18) !important;
    color: #1e3a8a !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.06) !important;
}

/* Group Icon */
.mud-nav-group > button.mud-nav-link .mud-nav-link-icon,
.mud-nav-group > .mud-nav-link .mud-nav-link-icon {
    color: #64748b !important;
    margin-inline-end: 8px !important;
    font-size: 1.25rem !important;
    transition: color 0.2s ease !important;
    flex-shrink: 0 !important;
}

.mud-nav-group.mud-nav-group-open > button.mud-nav-link .mud-nav-link-icon {
    color: #1e3a8a !important;
}

/* Group Title & NavLink Text: strictly 1 single line with smooth truncation guard */
.mud-nav-link,
.mud-nav-link .mud-nav-link-text,
.mud-nav-group > button.mud-nav-link .mud-nav-link-text,
.mud-nav-group > .mud-nav-link .mud-nav-link-text,
.mud-navmenu > .mud-nav-link .mud-nav-link-text,
.mud-nav-group .mud-collapse a.mud-nav-link,
.mud-nav-group .mud-collapse a.mud-nav-link .mud-nav-link-text {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
    line-height: 1.3 !important;
    letter-spacing: -0.015em !important;
}

/* Group Expand/Collapse Chevron */
.mud-nav-group .mud-nav-group-expand-icon {
    color: #94a3b8 !important;
    font-size: 1.15rem !important;
    transition: transform 0.25s ease, color 0.2s ease !important;
    margin-inline-start: 4px !important;
    flex-shrink: 0 !important;
}

.mud-nav-group.mud-nav-group-open .mud-nav-group-expand-icon {
    color: #1e3a8a !important;
}

/* Child Links inside Expanded Module - optimized horizontal space */
.mud-nav-group .mud-collapse {
    border-inline-start: 2px solid #e2e8f0;
    margin-inline-start: 12px !important;
    margin-top: 2px !important;
    margin-bottom: 4px !important;
    padding-inline-start: 2px !important;
}

.mud-nav-group .mud-collapse a.mud-nav-link {
    margin: 2px 2px !important;
    padding: 5px 8px !important;
    border-radius: 6px !important;
    font-size: 0.81rem !important;
    color: #475569 !important;
    background-color: transparent !important;
    transition: all 0.15s ease-in-out !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
}

.mud-nav-group .mud-collapse a.mud-nav-link:hover {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

.sidebar-search-container {
    width: 100%;
}

.sidebar-customize-btn {
    transition: all 0.2s ease-in-out !important;
}

.sidebar-customize-btn:hover {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #1e3a8a !important;
}

.mud-nav-group .mud-collapse a.mud-nav-link.active {
    background-color: rgba(30, 58, 138, 0.08) !important;
    color: #1e3a8a !important;
    font-weight: 600 !important;
}

.mud-nav-group .mud-collapse a.mud-nav-link .mud-nav-link-icon {
    font-size: 1.05rem !important;
    margin-inline-end: 6px !important;
    opacity: 0.85;
    flex-shrink: 0 !important;
}

/* Special styling for Favorites group if present */
.favorites-nav-group > button.mud-nav-link {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: #b45309 !important;
}
.favorites-nav-group > button.mud-nav-link .mud-nav-link-icon {
    color: #f59e0b !important;
}

/* Visual Stepper Styles */
.stepper-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 30px;
    padding: 0 20px;
}

.stepper-container::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s ease;
}

.step-item.active .step-circle {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.step-item.completed .step-circle {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.step-item.active .step-label {
    color: #111827;
    font-weight: 600;
}

/* ============= UX IMPROVEMENT STYLES ============= */

/* Financial KPI mini-cards */
.financial-kpi-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    border-left: 3px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Payroll cards */
.payroll-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.payroll-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}

/* Quick action cards */
.quick-action-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
}

/* KPI cards hover */
.kpi-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.2) !important;
}

/* Alert cards */
.alert-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.alert-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
}

/* Workflow step pills */
.workflow-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid currentColor;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Review row helper */
.review-row {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 6px;
}

/* Success page animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0);     }
}



.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25) !important;
}

.mud-input-control > .mud-input-control-input-container > .mud-input {
    background-color: rgba(255, 255, 255, 0.6) !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

.mud-input-control > .mud-input-control-input-container > .mud-input:hover, 
.mud-input-control > .mud-input-control-input-container > .mud-input:focus-within {
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

.premium-btn {
    border-radius: 30px !important;
    padding: 10px 24px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.premium-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.mud-appbar {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255,255,255,0.3) !important;
    color: #1a1a1a !important;
}

.mud-drawer {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px) !important;
}

.mud-tabs-toolbar {
    background: transparent !important;
}

.mud-tab.mud-tab-active {
    color: #23a6d5 !important;
    font-weight: 700 !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

/* ============= SLIM TABLE & SELECT STYLES ============= */
.slim-row-grid .mud-table-cell {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.slim-select .mud-input-control {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.slim-select .mud-input {
    min-height: 28px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.slim-select .mud-input-outlined {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.slim-select .mud-select-input {
    min-height: 28px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    margin-top: 0 !important;
    font-size: 0.875rem !important;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ═══════════════════════════════════════════════════════════════
   @media print — Admission Receipt & Reports
   Hides all chrome (nav, sidebar, buttons) and shows only content
   ═══════════════════════════════════════════════════════════════ */
@media print {
    /* Hide layout chrome */
    .mud-drawer,
    .mud-appbar,
    .mud-nav-menu,
    .nav-buttons,
    .step-indicator,
    .mud-button,
    .mud-icon-button,
    .mud-fab,
    .mud-snackbar-location,
    .mud-overlay { display: none !important; }

    /* Remove shadows and borders for clean print */
    .mud-paper,
    .mud-card,
    .glass-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    /* Force white background */
    body, .wizard-container, .content-wrapper {
        background: #ffffff !important;
        color: #000000 !important;
    }

    /* Show full content width */
    .mud-container, .wizard-container, .content-wrapper {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Make text fully black for ink saving */
    * { color: #000 !important; }

    /* Page settings */
    @page {
        size: A4 portrait;
        margin: 15mm 10mm;
    }
}

/* ═══════════════════════════════════════════════════════════════
   slim-row-grid — Ultra-compact rows matching header height
   Used in: ClassAssignment, TransportationAssignment, Buses
   ═══════════════════════════════════════════════════════════════ */

/* ── Row ── */
.slim-row-grid .mud-table-row,
.slim-row-grid tbody tr {
    height: 30px !important;
    max-height: 30px !important;
    box-sizing: border-box !important;
}

/* ── Body Cells ── */
.slim-row-grid .mud-table-cell,
.slim-row-grid td.mud-table-cell {
    padding: 0 8px !important;
    height: 30px !important;
    max-height: 30px !important;
    overflow: visible !important;
    vertical-align: middle !important;
    font-size: 0.8rem !important;
    box-sizing: border-box !important;
    line-height: 30px !important;
}

/* ── MudSelect / MudInput root wrappers ── */
.slim-row-grid .mud-input-control,
.slim-row-grid .mud-input-control-input-slot,
.slim-row-grid .mud-input-root,
.slim-row-grid .mud-input,
.slim-row-grid .mud-input-outlined,
.slim-row-grid .mud-input-adorned-end,
.slim-row-grid .mud-input-slot {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 26px !important;
    font-size: 0.78rem !important;
    box-sizing: border-box !important;
}

/* ── The actual text input inside MudSelect ── */
.slim-row-grid .mud-input > input,
.slim-row-grid .mud-select-input,
.slim-row-grid .mud-select-input-content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 26px !important;
    line-height: 26px !important;
    font-size: 0.78rem !important;
}

/* ── MudField inner wrapper ── */
.slim-row-grid .mud-field-field,
.slim-row-grid .mud-input-control > .mud-input-control-input-slot {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* ── Dropdown arrow icon ── */
.slim-row-grid .mud-input-adornment button,
.slim-row-grid .mud-input-adornment,
.slim-row-grid .mud-input-adornment .mud-icon-root {
    font-size: 16px !important;
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    line-height: 22px !important;
}

/* ── Checkbox column ── */
.slim-row-grid .mud-checkbox,
.slim-row-grid .mud-checkbox .mud-button-root {
    padding: 0 !important;
    margin: 0 !important;
    height: 22px !important;
    width: 22px !important;
}

/* ── Header stays readable (same height as before) ── */
.slim-row-grid th.mud-table-cell {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    font-size: 0.8rem !important;
    height: auto !important;
    max-height: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   @media print — Table pages (Buses / ClassAssignment / Transport)
   Hides all UI chrome — shows only the data table full-width
   ═══════════════════════════════════════════════════════════════ */
@media print {

    /* ── Hide all navigation & layout chrome ── */
    .mud-drawer,
    .mud-drawer-overlay,
    .mud-appbar,
    .mud-layout aside,
    nav,
    header,
    .mud-nav-menu { display: none !important; }

    /* ── Hide action buttons, filters, search, pager ── */
    .mud-button,
    .mud-icon-button,
    .mud-fab,
    .mud-text-field,
    .mud-select,
    .mud-input,
    .mud-toolbar,
    .mud-table-foot,
    .mud-data-grid-pager,
    .mud-data-grid-toolbar,
    .mud-checkbox,
    .select-column,
    .mud-select-input,
    [class*="SelectColumn"] { display: none !important; }

    /* ── Expand main content to full page ── */
    .mud-main-content,
    .mud-layout,
    main,
    body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ── Make the table fill the page ── */
    .mud-paper,
    .mud-data-grid,
    .mud-table {
        width: 100% !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    /* ── Slim rows for print ── */
    .mud-table-cell {
        padding: 4px 8px !important;
        font-size: 11pt !important;
    }

    th.mud-table-cell {
        background: #e8e8e8 !important;
        font-weight: bold !important;
        font-size: 11pt !important;
    }

    /* ── Make text black for ink ── */
    * { color: #000 !important; -webkit-print-color-adjust: exact; }

    /* ── Page setup ── */
    @page {
        size: A4 landscape;
        margin: 10mm 12mm;
    }
}

/* ═══════════════════════════════════════════════════════════════
   @media print — Admission Receipt  (triggered by body.printing-receipt)
   When PrintReceipt() is called, body gets this class.
   Everything is hidden except the #print-receipt div.
   ═══════════════════════════════════════════════════════════════ */
@media print {
    body.printing-receipt .mud-drawer,
    body.printing-receipt .mud-appbar,
    body.printing-receipt .mud-layout,
    body.printing-receipt .mud-main-content,
    body.printing-receipt nav,
    body.printing-receipt header,
    body.printing-receipt .wizard-container,
    body.printing-receipt #blazor-error-ui { display: none !important; }

    body.printing-receipt #print-receipt {
        display: block !important;
        position: fixed;
        top: 0; left: 0;
        width: 100%;
        z-index: 99999;
        background: #fff;
    }

    body.printing-receipt #print-receipt * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.printing-receipt {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.printing-receipt @page {
        size: A4 portrait;
        margin: 10mm;
    }
}

/* ═══════════════════════════════════════════════════════════════
   cell-native-select
   Native <select> inside DataGrid cells — fits perfectly in row
   height and styled to match MudBlazor outlined theme.
   ═══════════════════════════════════════════════════════════════ */
.cell-native-select {
    width:            100%;
    height:           28px;
    padding:          0 6px;
    font-size:        0.78rem;
    font-family:      inherit;
    color:            rgba(0,0,0,0.87);
    background-color: #fff;
    border:           1px solid rgba(0,0,0,0.23);
    border-radius:    4px;
    box-sizing:       border-box;
    outline:          none;
    cursor:           pointer;
    direction:        rtl;
    transition:       border-color 0.2s ease;
}
.cell-native-select:hover:not(:disabled) { border-color: rgba(0,0,0,0.87); }
.cell-native-select:focus {
    border-color: var(--mud-palette-primary, #594ae2);
    border-width: 2px;
    box-shadow: none;
}
.cell-native-select:disabled {
    background-color: rgba(0,0,0,0.04);
    color:            rgba(0,0,0,0.38);
    border-color:     rgba(0,0,0,0.12);
    cursor:           not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   slim-row-grid + slim-select
   DataGrid rows with inline MudSelect — must NOT expand row height.
   ═══════════════════════════════════════════════════════════════ */

/* Lock row height — cells never grow for any child */
.slim-row-grid .mud-table-row {
    height: 34px !important;
    max-height: 34px !important;
}
.slim-row-grid .mud-table-cell {
    padding: 2px 8px !important;
    vertical-align: middle !important;
    overflow: visible !important;
    height: 34px !important;
    max-height: 34px !important;
    box-sizing: border-box;
}

/* ── Layer 1: mud-input-control (outermost wrapper) ── */
.slim-select .mud-input-control {
    margin:     0 !important;
    padding:    0 !important;
    min-height: 0 !important;
    height:     26px !important;
}

/* ── Layer 2: mud-input-root (THE main culprit — 56px default) ── */
.slim-select .mud-input-root,
.slim-select .mud-input-root-outlined {
    min-height: 26px !important;
    height:     26px !important;
    max-height: 26px !important;
    padding:    0 !important;
    margin:     0 !important;
    align-items: center;
}

/* ── Layer 3: mud-input (the visual outlined box) ── */
.slim-select .mud-input.mud-input-outlined {
    height:     26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding:    0 30px 0 8px !important;
    font-size:  0.78rem !important;
    line-height: 26px !important;
    display:    flex;
    align-items: center;
}

/* ── Layer 4: mud-select-input (the value text span) ── */
.slim-select .mud-select-input {
    padding:     0 !important;
    height:      26px !important;
    min-height:  26px !important;
    max-height:  26px !important;
    font-size:   0.78rem !important;
    line-height: 26px !important;
    overflow:    hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display:     flex !important;
    align-items: center !important;
}

/* ── Floating label — hidden (using Placeholder only) ── */
.slim-select .mud-input-label,
.slim-select .mud-input-label-inputcontrol,
.slim-select label { display: none !important; }

/* ── Fieldset notch — collapses the gap reserved for the label ── */
.slim-select .mud-input-outlined-border {
    top:     0 !important;
    bottom:  0 !important;
}
.slim-select legend,
.slim-select .mud-notch-notch {
    display:          none !important;
    width:            0   !important;
}
.slim-select .mud-notch-leading { border-top-width: 1px !important; }
.slim-select .mud-notch-trailing { border-top-width: 1px !important; }

/* ── Chevron (dropdown arrow) ── */
.slim-select .mud-input-adornment,
.slim-select .mud-input-adornment-end {
    height:     26px !important;
    min-height: 0   !important;
    padding:    0 2px !important;
    align-self: center;
}
.slim-select .mud-input-adornment .mud-icon-root,
.slim-select .mud-input-adornment-end .mud-icon-root {
    font-size: 15px !important;
}

/* ── Helper text row (blank space under the input) ── */
.slim-select .mud-input-helper-text,
.slim-select .mud-input-control-helper-container { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════
   GLOBAL ENTERPRISE PRINT ENGINE — ALL TEMPLATES & DIALOGS
   Fixes: Bleeding backgrounds, MudBlazor dark overlay, stripped colors,
   cut-off scrollbars, and non-printable control clutter across the entire ERP.
   ══════════════════════════════════════════════════════════════════════ */
@media print {
    /* 1. Force exact colors and background graphics everywhere */
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        box-sizing: border-box !important;
    }

    /* 2. Hide all non-printable UI chrome */
    .no-print,
    .d-print-none,
    .mud-appbar,
    .mud-drawer,
    .mud-drawer-open,
    .mud-drawer-close,
    .mud-popover-provider,
    .mud-snackbar-provider,
    .mud-dialog-actions,
    .mud-overlay,
    .mud-backdrop,
    .mud-tooltip-root,
    .mud-dialog-title,
    header,
    nav,
    aside,
    footer,
    button:not(.allow-print),
    .mud-button-root:not(.allow-print) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 3. When a MudBlazor dialog is open, suppress background page */
    body:has(.mud-dialog-container) .mud-layout,
    body:has(.mud-dialog-container) .mud-main-content {
        display: none !important;
    }

    /* 4. Reset dialog containers for multi-page print flow */
    .mud-dialog-provider,
    .mud-dialog-container {
        position: static !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
    }

    .mud-dialog {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible !important;
    }

    .mud-dialog-content {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        display: block !important;
    }

    /* 5. Clean HTML & Body root */
    html, body {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        box-shadow: none !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   EXECUTIVE PASTEL DESIGN SYSTEM (Dashboards & KPIs)
   Lean, Dense, Authoritative, World-Class
   ══════════════════════════════════════════════════════════════════════════ */
:root {
    --exec-slate-bg: #f8fafc;
    --exec-slate-border: #e2e8f0;
    --exec-slate-fg: #0f172a;
    --exec-slate-sub: #64748b;
    --exec-slate-icon-bg: #e2e8f0;
    --exec-slate-icon-fg: #334155;

    --exec-sky-bg: #f0f9ff;
    --exec-sky-border: #bae6fd;
    --exec-sky-fg: #0369a1;
    --exec-sky-sub: #0284c7;
    --exec-sky-icon-bg: #e0f2fe;
    --exec-sky-icon-fg: #0284c7;

    --exec-sage-bg: #f0fdf4;
    --exec-sage-border: #bbf7d0;
    --exec-sage-fg: #15803d;
    --exec-sage-sub: #16a34a;
    --exec-sage-icon-bg: #dcfce7;
    --exec-sage-icon-fg: #166534;

    --exec-lavender-bg: #f5f3ff;
    --exec-lavender-border: #ddd6fe;
    --exec-lavender-fg: #6d28d9;
    --exec-lavender-sub: #7c3aed;
    --exec-lavender-icon-bg: #ede9fe;
    --exec-lavender-icon-fg: #5b21b6;

    --exec-amber-bg: #fffbeb;
    --exec-amber-border: #fde68a;
    --exec-amber-fg: #b45309;
    --exec-amber-sub: #d97706;
    --exec-amber-icon-bg: #fef3c7;
    --exec-amber-icon-fg: #92400e;

    --exec-rose-bg: #fff1f2;
    --exec-rose-border: #fecdd3;
    --exec-rose-fg: #be123c;
    --exec-rose-sub: #e11d48;
    --exec-rose-icon-bg: #ffe4e6;
    --exec-rose-icon-fg: #9f1239;

    --exec-mint-bg: #f0fdfa;
    --exec-mint-border: #99f6e4;
    --exec-mint-fg: #0f766e;
    --exec-mint-sub: #0d9488;
    --exec-mint-icon-bg: #ccfbf1;
    --exec-mint-icon-fg: #115e59;
}

/* Lean Executive KPI Card */
.exec-kpi-card {
    background: #ffffff;
    border: 1px solid var(--exec-slate-border);
    border-radius: 12px;
    padding: 12px 14px;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.exec-kpi-card.interactive {
    cursor: pointer;
}

.exec-kpi-card.interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

.exec-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.exec-kpi-label {
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--exec-slate-sub);
}

.exec-kpi-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.exec-kpi-card:hover .exec-kpi-icon-wrap {
    transform: scale(1.06);
}

.exec-kpi-body {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.exec-kpi-val {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
    color: #0f172a;
}

.exec-kpi-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--exec-slate-sub);
    white-space: nowrap;
}

/* Pastel Card Themes */
.exec-kpi-card.kpi-sky {
    background: var(--exec-sky-bg);
    border-color: var(--exec-sky-border);
}
.exec-kpi-card.kpi-sky .exec-kpi-icon-wrap {
    background: var(--exec-sky-icon-bg);
    color: var(--exec-sky-icon-fg);
}
.exec-kpi-card.kpi-sky .exec-kpi-val {
    color: var(--exec-sky-fg);
}
.exec-kpi-card.kpi-sky .exec-kpi-label {
    color: var(--exec-sky-sub);
}

.exec-kpi-card.kpi-sage {
    background: var(--exec-sage-bg);
    border-color: var(--exec-sage-border);
}
.exec-kpi-card.kpi-sage .exec-kpi-icon-wrap {
    background: var(--exec-sage-icon-bg);
    color: var(--exec-sage-icon-fg);
}
.exec-kpi-card.kpi-sage .exec-kpi-val {
    color: var(--exec-sage-fg);
}
.exec-kpi-card.kpi-sage .exec-kpi-label {
    color: var(--exec-sage-sub);
}

.exec-kpi-card.kpi-lavender {
    background: var(--exec-lavender-bg);
    border-color: var(--exec-lavender-border);
}
.exec-kpi-card.kpi-lavender .exec-kpi-icon-wrap {
    background: var(--exec-lavender-icon-bg);
    color: var(--exec-lavender-icon-fg);
}
.exec-kpi-card.kpi-lavender .exec-kpi-val {
    color: var(--exec-lavender-fg);
}
.exec-kpi-card.kpi-lavender .exec-kpi-label {
    color: var(--exec-lavender-sub);
}

.exec-kpi-card.kpi-amber {
    background: var(--exec-amber-bg);
    border-color: var(--exec-amber-border);
}
.exec-kpi-card.kpi-amber .exec-kpi-icon-wrap {
    background: var(--exec-amber-icon-bg);
    color: var(--exec-amber-icon-fg);
}
.exec-kpi-card.kpi-amber .exec-kpi-val {
    color: var(--exec-amber-fg);
}
.exec-kpi-card.kpi-amber .exec-kpi-label {
    color: var(--exec-amber-sub);
}

.exec-kpi-card.kpi-rose {
    background: var(--exec-rose-bg);
    border-color: var(--exec-rose-border);
}
.exec-kpi-card.kpi-rose .exec-kpi-icon-wrap {
    background: var(--exec-rose-icon-bg);
    color: var(--exec-rose-icon-fg);
}
.exec-kpi-card.kpi-rose .exec-kpi-val {
    color: var(--exec-rose-fg);
}
.exec-kpi-card.kpi-rose .exec-kpi-label {
    color: var(--exec-rose-sub);
}

.exec-kpi-card.kpi-mint {
    background: var(--exec-mint-bg);
    border-color: var(--exec-mint-border);
}
.exec-kpi-card.kpi-mint .exec-kpi-icon-wrap {
    background: var(--exec-mint-icon-bg);
    color: var(--exec-mint-icon-fg);
}
.exec-kpi-card.kpi-mint .exec-kpi-val {
    color: var(--exec-mint-fg);
}
.exec-kpi-card.kpi-mint .exec-kpi-label {
    color: var(--exec-mint-sub);
}

.exec-kpi-card.kpi-slate {
    background: var(--exec-slate-bg);
    border-color: var(--exec-slate-border);
}
.exec-kpi-card.kpi-slate .exec-kpi-icon-wrap {
    background: var(--exec-slate-icon-bg);
    color: var(--exec-slate-icon-fg);
}
.exec-kpi-card.kpi-slate .exec-kpi-val {
    color: var(--exec-slate-fg);
}
.exec-kpi-card.kpi-slate .exec-kpi-label {
    color: var(--exec-slate-sub);
}

/* Compact Quick Action Pill */
.exec-quick-pill {
    background: #ffffff;
    border: 1px solid var(--exec-slate-border);
    border-radius: 10px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.exec-quick-pill:hover {
    border-color: #93c5fd;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.exec-pill-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.exec-pill-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.exec-pill-desc {
    font-size: 0.68rem;
    color: #64748b;
    line-height: 1.1;
    margin-top: 1px;
}

/* Executive Alert Card */
.exec-alert-pill {
    background: #ffffff;
    border: 1px solid #fed7aa;
    border-right: 4px solid #f97316;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.18s ease;
    cursor: pointer;
}

.exec-alert-pill:hover {
    background: #fffaf0;
    transform: translateY(-1px);
}

/* Responsive Dense Layout Rules */
@media (max-width: 600px) {
    .exec-kpi-val {
        font-size: 1.3rem;
    }
    .exec-kpi-label {
        font-size: 0.68rem;
    }
    .exec-kpi-card {
        padding: 10px;
    }
}

/* ==========================================================================
   GLOBAL RESPONSIVE RESILIENCE SUITE (درع التجاوب المركزي الشامل)
   ========================================================================== */

/* 1. Global Tables & Grids Protection (حماية الجداول من تشويه الصفحات) */
.mud-table-root,
.mud-data-grid {
    width: 100% !important;
    max-width: 100% !important;
}

.mud-table-container {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.mud-table-container::-webkit-scrollbar {
    height: 6px;
}

.mud-table-container::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.6);
    border-radius: 4px;
}

.mud-table-container::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 4px;
}

.mud-table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
}

/* 2. Global Mobile Rules (@media max-width: 600px) */
@media (max-width: 600px) {
    /* Fluid Mobile Typography Scale (سلم الخطوط المصغر للجوال لمنع الانبعاج) */
    .mud-typography-h3 {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
    }
    .mud-typography-h4 {
        font-size: 1.18rem !important;
        line-height: 1.3 !important;
    }
    .mud-typography-h5 {
        font-size: 1.05rem !important;
        line-height: 1.3 !important;
    }
    .mud-typography-h6 {
        font-size: 0.92rem !important;
        line-height: 1.3 !important;
    }
    .mud-typography-subtitle1 {
        font-size: 0.85rem !important;
    }
    .mud-typography-subtitle2 {
        font-size: 0.8rem !important;
    }
    .mud-typography-body1 {
        font-size: 0.85rem !important;
    }
    .mud-typography-body2 {
        font-size: 0.78rem !important;
    }

    /* Buttons & Badges Protection (منع التفاف وانكسار الأزرار والبادجات) */
    .mud-button {
        letter-spacing: 0.2px;
    }
    .mud-button:not(.mud-button-full-width) .mud-button-label {
        white-space: nowrap !important;
    }
    .mud-chip {
        white-space: nowrap !important;
        font-size: 0.72rem !important;
        height: 24px !important;
    }
    .mud-chip .mud-chip-content {
        white-space: nowrap !important;
    }

    /* Table Compact Cells on Mobile */
    .mud-table-cell {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }
    .mud-table-head .mud-table-cell {
        white-space: nowrap !important;
        font-weight: 700 !important;
        font-size: 0.78rem !important;
    }

    /* Global Mobile Dialogs (نوافذ حوارية ملائمة لعرض الجوال بالكامل) */
    .mud-dialog {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 8px auto !important;
        border-radius: 12px !important;
    }
    .mud-dialog-title {
        padding: 12px 16px !important;
        font-size: 0.98rem !important;
    }
    .mud-dialog-content {
        max-height: 74vh !important;
        overflow-y: auto !important;
        padding: 12px 14px !important;
        -webkit-overflow-scrolling: touch;
    }
    .mud-dialog-actions {
        padding: 8px 14px 12px 14px !important;
        gap: 6px;
        flex-wrap: wrap;
    }

    /* Wizard / Stepper Mobile Adjustments */
    .step-label {
        font-size: 0.72rem !important;
    }
    .step-circle {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }

    /* ══════════════════════════════════════════════════════════════════════════
       CENTRALIZED HERO BANNER PROTECTION — covers ALL dark gradient banners
       across the entire system without modifying any .razor files.
       يشمل جميع البانرات الداكنة في كامل النظام بدون لمس أي ملف .razor
       ══════════════════════════════════════════════════════════════════════════ */

    /* --- A. Shrink the dark card itself --- */
    .mud-card:has(.mud-avatar) {
        padding: 10px 12px !important;
        border-radius: 12px !important;
        margin-bottom: 10px !important;
    }

    /* --- B. Stack title-group and actions vertically --- */
    .mud-card:has(.mud-avatar) > .mud-card-content > .d-flex.justify-space-between,
    .mud-card:has(.mud-avatar) > div > .d-flex.justify-space-between,
    .mud-card:has(.mud-avatar) .d-flex.justify-space-between {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    /* --- C. Title row: keep icon + text side-by-side, never wrap --- */
    .mud-card:has(.mud-avatar) .d-flex.align-center.gap-3,
    .mud-card:has(.mud-avatar) .d-flex.align-center.gap-2 {
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }

    /* --- D. Shrink the avatar icon --- */
    .mud-card:has(.mud-avatar) > .mud-card-content .mud-avatar,
    .mud-card:has(.mud-avatar) .mud-card-content .mud-avatar,
    .mud-card:has(.mud-avatar) .mud-avatar {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        flex-shrink: 0 !important;
    }
    .mud-card:has(.mud-avatar) .mud-avatar .mud-icon-root {
        font-size: 1.1rem !important;
    }

    /* --- E. Force titles to stay on one line (nowrap) --- */
    .mud-card:has(.mud-avatar) .mud-typography-h5,
    .mud-card:has(.mud-avatar) .mud-typography-h4,
    .mud-card:has(.mud-avatar) .mud-typography-h6 {
        font-size: 1.05rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: calc(100vw - 100px) !important;
    }

    /* --- F. Hide decorative Latin chips (keeps Arabic title single-line) --- */
    .mud-card:has(.mud-avatar) .mud-chip {
        display: none !important;
    }

    /* --- G. Clamp subtitle to 2 lines max --- */
    .mud-card:has(.mud-avatar) .mud-typography-caption {
        font-size: 0.68rem !important;
        line-height: 1.25 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    /* --- H. Action buttons: full width, stacked, clearly visible --- */
    .mud-card:has(.mud-avatar) .d-flex.align-center.gap-2:last-child,
    .mud-card:has(.mud-avatar) .d-flex.align-center.gap-3:last-child {
        width: 100% !important;
        flex-wrap: wrap !important;
    }
    .mud-card:has(.mud-avatar) .d-flex:last-child > .mud-button-root,
    .mud-card:has(.mud-avatar) .d-flex:last-child > .authorize-permission .mud-button-root {
        flex: 1 1 auto !important;
        width: 100% !important;
        justify-content: center !important;
        font-size: 0.8rem !important;
        padding: 7px 10px !important;
        border-radius: 8px !important;
    }

    /* ══════════════════════════════════════════════════════════════════════════
       3. GLOBAL 2-COLUMN DENSE KPI CARDS (MudGrid-based)
       بطاقتان رشيقتان في كل سطر — لجميع MudGrid KPI في النظام
       ══════════════════════════════════════════════════════════════════════════ */

    /* xs=6 items already render at 50% — just compress the padding inside */
    .mud-grid-item-xs-6:has(.mud-paper) .mud-paper,
    .mud-grid-item-xs-12.mud-grid-item-sm-6:has(.mud-paper) .mud-paper,
    .mud-grid-item-xs-12.mud-grid-item-md-3:has(.mud-paper) .mud-paper,
    .mud-grid-item-xs-12.mud-grid-item-md-4:has(.mud-paper) .mud-paper {
        padding: 6px 8px !important;
        border-radius: 8px !important;
    }

    /* Force xs=12 items with MudPaper to also render at 50% */
    .mud-grid-item-xs-12.mud-grid-item-sm-6:has(.mud-paper),
    .mud-grid-item-xs-12.mud-grid-item-md-3:has(.mud-paper),
    .mud-grid-item-xs-12.mud-grid-item-md-4:has(.mud-paper),
    .mud-grid-item-xs-12.mud-grid-item-md-2:has(.mud-paper) {
        flex-basis: 50% !important;
        max-width: 50% !important;
        padding: 3px !important;
    }

    /* Shrink avatar icons inside KPI cards */
    .mud-grid-item-xs-6:has(.mud-paper) .mud-paper .mud-avatar,
    .mud-grid-item-xs-12:has(.mud-paper) .mud-paper .mud-avatar {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
    }
    .mud-grid-item-xs-6:has(.mud-paper) .mud-paper .mud-avatar .mud-icon-root,
    .mud-grid-item-xs-12:has(.mud-paper) .mud-paper .mud-avatar .mud-icon-root {
        font-size: 0.9rem !important;
    }

    /* Shrink KPI values and labels inside cards */
    .mud-grid-item-xs-6:has(.mud-paper) .mud-paper .mud-typography-h5,
    .mud-grid-item-xs-6:has(.mud-paper) .mud-paper .mud-typography-h4,
    .mud-grid-item-xs-6:has(.mud-paper) .mud-paper .mud-typography-h6,
    .mud-grid-item-xs-12:has(.mud-paper) .mud-paper .mud-typography-h5,
    .mud-grid-item-xs-12:has(.mud-paper) .mud-paper .mud-typography-h4 {
        font-size: 1.05rem !important;
        margin-top: 1px !important;
        font-weight: 800 !important;
        line-height: 1.1 !important;
    }
    .mud-grid-item-xs-6:has(.mud-paper) .mud-paper .mud-typography-caption,
    .mud-grid-item-xs-12:has(.mud-paper) .mud-paper .mud-typography-caption {
        font-size: 0.6rem !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* ══════════════════════════════════════════════════════════════════════════
       4. UNIVERSAL 2-COLUMN KPI GRIDS (CSS Grid dashboards)
       ══════════════════════════════════════════════════════════════════════════ */
    .kpi-grid,
    .ai-kpi-row,
    .pb-kpi-row,
    .cn-kpi-row,
    .si-kpi-strip,
    .ip-kpi-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    .kpi-grid > .kpi-card:last-child {
        grid-column: 1 / -1 !important;
    }
    .kpi-card, .ai-kpi, .pb-kpi, .cn-kpi, .si-kpi, .ip-kpi {
        padding: 6px 8px !important;
        border-radius: 8px !important;
    }
    .kpi-value, .ai-kpi-value, .si-kpi-value, .ip-kpi-value {
        font-size: 1.05rem !important;
    }
    .kpi-label, .ai-kpi-label, .si-kpi-label, .ip-kpi-label {
        font-size: 0.62rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* ══════════════════════════════════════════════════════════════════════════
       5. ENTERPRISE PAGE HEADER (EnterprisePageHeader.razor component)
       ══════════════════════════════════════════════════════════════════════════ */
    .enterprise-page-header {
        padding: 8px 12px !important;
        min-height: 48px !important;
        margin-bottom: 8px !important;
        margin-top: 4px !important;
    }
    .enterprise-page-header .header-inner { gap: 6px !important; }
    .enterprise-page-header .header-icon-box { width: 34px !important; height: 34px !important; border-radius: 8px !important; }
    .enterprise-page-header .header-icon { font-size: 18px !important; }
    .enterprise-page-header .header-main-title { font-size: 1.05rem !important; white-space: nowrap !important; }
    .enterprise-page-header .header-category { font-size: 9.5px !important; }
    .enterprise-page-header .header-subtitle { font-size: 10.5px !important; }

    /* General content spacing reduction on mobile */
    .mud-main-content {
        padding-inline: 8px !important;
    }
}


