/* ===== تنسيق موحد للأزرار - حواف دائرية بسيطة ومرتبة ===== */
.btn, a.btn, button.btn, input[type="submit"], input[type="button"], input[type="reset"] {
    border-radius: 0.5rem !important; /* حواف دائرية موحدة */
    padding: 0.5rem 1rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.btn:hover, a.btn:hover, button.btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.btn-sm {
    border-radius: 0.4rem !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.875rem !important;
}

.btn-lg {
    border-radius: 0.6rem !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 1.125rem !important;
}

/* ===== تجاوز قوي جداً لألوان الأزرار - يجب أن يكون في البداية ===== */
/* Primary */
.btn-primary, a.btn-primary, button.btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}
/* Success */
.btn-success, a.btn-success, button.btn-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}
/* Danger */
.btn-danger, a.btn-danger, button.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}
/* Warning */
.btn-warning, a.btn-warning, button.btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
}
/* Info */
.btn-info, a.btn-info, button.btn-info {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}
/* Secondary */
.btn-secondary, a.btn-secondary, button.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}
/* Outline Primary - ألوان غامقة للنص */
.btn-outline-primary, a.btn-outline-primary, button.btn-outline-primary {
    color: #0a58ca !important;
    border-color: #0a58ca !important;
    background-color: transparent !important;
    font-weight: 700 !important;
}
.btn-outline-primary:hover, a.btn-outline-primary:hover, button.btn-outline-primary:hover {
    background-color: #0a58ca !important;
    border-color: #0a58ca !important;
    color: #ffffff !important;
}
/* Outline Success - ألوان غامقة للنص */
.btn-outline-success, a.btn-outline-success, button.btn-outline-success {
    color: #146c43 !important;
    border-color: #146c43 !important;
    background-color: transparent !important;
    font-weight: 700 !important;
}
.btn-outline-success:hover, a.btn-outline-success:hover, button.btn-outline-success:hover {
    background-color: #146c43 !important;
    border-color: #146c43 !important;
    color: #ffffff !important;
}
/* Outline Danger - ألوان غامقة للنص */
.btn-outline-danger, a.btn-outline-danger, button.btn-outline-danger {
    color: #b02a37 !important;
    border-color: #b02a37 !important;
    background-color: transparent !important;
    font-weight: 700 !important;
}
.btn-outline-danger:hover, a.btn-outline-danger:hover, button.btn-outline-danger:hover {
    background-color: #b02a37 !important;
    border-color: #b02a37 !important;
    color: #ffffff !important;
}
/* Outline Warning - ألوان غامقة للنص */
.btn-outline-warning, a.btn-outline-warning, button.btn-outline-warning {
    color: #cc9a06 !important;
    border-color: #cc9a06 !important;
    background-color: transparent !important;
    font-weight: 700 !important;
}
.btn-outline-warning:hover, a.btn-outline-warning:hover, button.btn-outline-warning:hover {
    background-color: #cc9a06 !important;
    border-color: #cc9a06 !important;
    color: #ffffff !important;
}
/* Outline Info - ألوان غامقة للنص */
.btn-outline-info, a.btn-outline-info, button.btn-outline-info {
    color: #087990 !important;
    border-color: #087990 !important;
    background-color: transparent !important;
    font-weight: 700 !important;
}
.btn-outline-info:hover, a.btn-outline-info:hover, button.btn-outline-info:hover {
    background-color: #087990 !important;
    border-color: #087990 !important;
    color: #ffffff !important;
}
/* Outline Secondary - ألوان غامقة للنص */
.btn-outline-secondary, a.btn-outline-secondary, button.btn-outline-secondary {
    color: #495057 !important;
    border-color: #495057 !important;
    background-color: transparent !important;
    font-weight: 700 !important;
}
.btn-outline-secondary:hover, a.btn-outline-secondary:hover, button.btn-outline-secondary:hover {
    background-color: #495057 !important;
    border-color: #495057 !important;
    color: #ffffff !important;
}

/* Cairo font faces (local files only) */
@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/cairo/Cairo-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/static/fonts/cairo/Cairo-SemiBold.ttf') format('truetype');
}

/* Ensure medium (500) weight is available and mapped to Cairo-Medium.ttf */
@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/static/fonts/cairo/Cairo-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/static/fonts/cairo/Cairo-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/static/fonts/cairo/Cairo-ExtraBold.ttf') format('truetype');
}

/* تطبيق خط Cairo على جميع الأزرار */
.btn, button, input[type="submit"], input[type="button"], input[type="reset"],
a.btn, button.btn {
    font-family: 'Cairo', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    padding: 0.25rem 0.5rem !important;
}

/* أزرار صغيرة */
.btn-sm {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.4rem !important;
}
body {
    background-color: #f8f9fa;
    font-family: 'Cairo', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

/* تطبيق خط Cairo على جميع العناوين الرئيسية */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
}

/* Heading weights with Cairo */
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 600; }
h4 { font-weight: 600; }
h5 { font-weight: 600; }
h6 { font-weight: 500; }

/* Reduce main page title size */
.content-wrapper h1 {
    font-size: 1.75rem;
}

/* RTL adjustments: right-align dropdown menus and items */
html[dir="rtl"] .dropdown-menu {
    right: 0;
    left: auto;
    text-align: right;
}

html[dir="rtl"] .dropdown-item {
    text-align: right;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* ===== ألوان الأزرار فقط ===== */

/* أزرار Primary - زرقاء */
.btn-primary,
.btn-primary.text-white {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.text-white:hover,
.btn-primary.text-white:focus,
.btn-primary.text-white:active {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
    color: #ffffff !important;
}

/* أزرار Success - خضراء */
.btn-success,
.btn-success.text-white {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.text-white:hover,
.btn-success.text-white:focus,
.btn-success.text-white:active {
    background-color: #157347 !important;
    border-color: #146c43 !important;
    color: #ffffff !important;
}

/* أزرار Danger - حمراء */
.btn-danger,
.btn-danger.text-white {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.text-white:hover,
.btn-danger.text-white:focus,
.btn-danger.text-white:active {
    background-color: #bb2d3b !important;
    border-color: #b02a37 !important;
    color: #ffffff !important;
}

/* أزرار Warning - صفراء */
.btn-warning,
.btn-warning.text-dark {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.text-dark:hover,
.btn-warning.text-dark:focus,
.btn-warning.text-dark:active {
    background-color: #ffca2c !important;
    border-color: #ffc720 !important;
    color: #000000 !important;
}

/* أزرار Info - فيروزية */
.btn-info,
.btn-info.text-white,
.btn-info.text-dark {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.text-white:hover,
.btn-info.text-white:focus,
.btn-info.text-white:active,
.btn-info.text-dark:hover,
.btn-info.text-dark:focus,
.btn-info.text-dark:active {
    background-color: #31d2f2 !important;
    border-color: #25cff2 !important;
    color: #000000 !important;
}

/* أزرار Secondary - رمادية */
.btn-secondary,
.btn-secondary.text-white {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-secondary.text-white:hover,
.btn-secondary.text-white:focus,
.btn-secondary.text-white:active {
    background-color: #5c636a !important;
    border-color: #565e64 !important;
    color: #ffffff !important;
}

/* أزرار Outline */
.btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.btn-outline-success {
    color: #198754 !important;
    border-color: #198754 !important;
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

.btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.btn-outline-warning {
    color: #ffc107 !important;
    border-color: #ffc107 !important;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
}

.btn-outline-info {
    color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
}

.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}

.btn-outline-secondary {
    color: #6c757d !important;
    border-color: #6c757d !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

/* Language selector buttons: show individual rounded corners (not merged) */
.btn-group[aria-label="Language selector"] {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    gap: 0.35rem; /* spacing so borders are visible outside */
    width: auto !important;
}
.btn-group[aria-label="Language selector"] .btn {
    border-radius: 0.6rem !important; /* full rounded corners on each button */
    box-shadow: none !important;
    padding: 0.35rem 0.7rem;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}
.btn-group[aria-label="Language selector"] .btn-outline-primary {
    border-width: 2px !important;
}

/* Quick action buttons: uniform small rounded corners */
.quick-actions {
    display: inline-flex;
    gap: 0.5rem; /* keep visual separation so all corners show */
}
.quick-actions .btn {
    border-radius: 0.375rem !important; /* small consistent rounding on all corners */
}

/* (Reverted) Do not override global Bootstrap button radius to preserve original layout */

/* Button spacing for action groups so they look balanced */
/* Preferred: use flex + gap for consistent spacing */
.app-actions { /* removed unified app actions styling to restore original layout */ /* noop */ }

/* Avoid overriding Bootstrap spacing for generic .btn-group to prevent layout shifts */

/* Custom styles for Select2 elements */
.select2-container--default .select2-selection--single {
    background-color: #ffffff; /* Solid white background */
    border: 2px solid #007bff !important; /* More noticeable border color */
    border-radius: 0.25rem; /* Rounded corners */
    color: #495057; /* Dark text color */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); /* More pronounced shadow */
}

.select2-container--default .select2-selection--single:hover {
    border-color: #0056b3 !important; /* Darker border on hover */
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #495057; /* Ensure the text is dark */
    font-size: 16px; /* Increase font size */
}

.select2-container .select2-selection--single {
    height: 38px !important;
    border: 1px solid #335c85 !important; 
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

.select2-container--default .select2-selection--single:focus {
    border-color: #0056b3; /* Darker border on focus */
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* Add shadow on focus */
}

.navbar-brand {
    font-weight: bold;
}

/* Apply Cairo font to top navbar */
.navbar,
.navbar .nav-link,
.navbar .navbar-brand,
.navbar .dropdown-item {
    font-family: 'Cairo', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

/* Bold weight for top navbar items */
.navbar .nav-link,
.navbar .navbar-brand {
    font-weight: 700;
    font-size: 0.9rem !important;
}

/* تصغير خط القوائم المنسدلة */
.navbar .dropdown-item {
    font-size: 0.85rem !important;
    padding: 0.4rem 1rem !important;
}

/* تصغير خط عناوين القوائم المنسدلة */
.navbar .dropdown-menu {
    font-size: 0.85rem !important;
}

/* Improve navbar link contrast on primary background */
.navbar.navbar-dark .navbar-brand {
    color: #ffffff;
}

.navbar.navbar-dark .navbar-nav .nav-link {
    color: #ffffff; /* override Bootstrap rgba(255,255,255,.55) */
}

.navbar.navbar-dark .navbar-nav .nav-link:hover,
.navbar.navbar-dark .navbar-nav .nav-link:focus {
    color: #e6f0ff; /* subtle lighter tint on hover */
}

.navbar.navbar-dark .navbar-nav .nav-link.active,
.navbar.navbar-dark .navbar-nav .show > .nav-link {
    color: #ffffff;
}

.navbar.navbar-dark .navbar-nav .nav-link.disabled {
    color: rgba(255, 255, 255, 0.5);
}

.navbar .live-clock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #f2f4f7, #e5e7eb);
    color: #0b2038;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    padding: 0.35rem 0.75rem;
    margin-inline-start: 0.5rem; /* RTL/LTR aware */
    box-shadow: 0 1px 2px rgba(0,0,0,0.06) inset, 0 1px 2px rgba(0,0,0,0.08);
    text-shadow: none;
}

.navbar .live-clock-badge:hover {
    background: linear-gradient(135deg, #eaecef, #dfe3e8);
}

.navbar .live-clock-badge .clock-icon {
    display: none; /* إخفاء أيقونة الساعة */
}

.navbar .live-clock-badge .live-clock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.navbar .live-clock-badge .live-clock-time {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums; /* align changing digits */
    font-feature-settings: "tnum" 1;
    line-height: 1.1;
}

.navbar .live-clock-badge .live-clock-date {
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.2px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    line-height: 1.1;
    opacity: 0.85;
}

.content-wrapper {
    padding: 20px;
}

.table-responsive {
    margin-top: 20px;
}

.currency {
    font-family: monospace;
}

/* Select2 Bootstrap 5 Integration */
.select2-container--bootstrap-5 .select2-selection {
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.select2-container--bootstrap-5 .select2-selection--single {
    padding-right: 2.25rem;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding: 0;
    line-height: 1.5;
    color: #212529;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    width: 0.75rem;
    height: 0.75rem;
    transform: translateY(-50%);
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #ced4da;
    border-radius: 0.375rem;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd;
    color: #fff;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__option[aria-selected=true] {
    background-color: #e9ecef;
}

/* Vendor card accents and icon backgrounds */
.vendor-card .card-header { background-color: transparent; }

/* Colored left border accents for vendor cards (RTL aware) */
.vendor-card-basic { border-left: 4px solid #0d6efd; }
.vendor-card-contact { border-left: 4px solid #198754; }
.vendor-card-financial { border-left: 4px solid #ffc107; }
.vendor-card-additional { border-left: 4px solid #0dcaf0; }
.vendor-card-attachments { border-left: 4px solid #6c757d; }

/* For RTL layout place border on the right instead */
html[dir="rtl"] .vendor-card-basic,
html[dir="rtl"] .vendor-card-contact,
html[dir="rtl"] .vendor-card-financial,
html[dir="rtl"] .vendor-card-additional,
html[dir="rtl"] .vendor-card-attachments {
    border-left: none;
    border-right: 4px solid transparent; /* will be overridden below */
}
html[dir="rtl"] .vendor-card-basic { border-right-color: #0d6efd; }
html[dir="rtl"] .vendor-card-contact { border-right-color: #198754; }
html[dir="rtl"] .vendor-card-financial { border-right-color: #ffc107; }
html[dir="rtl"] .vendor-card-additional { border-right-color: #0dcaf0; }
html[dir="rtl"] .vendor-card-attachments { border-right-color: #6c757d; }

.vendor-card .card-header h5 { margin: 0; font-weight: 600; padding: 0.75rem 1rem; }

/* Remove colored icon boxes, instead color the header background */
.vendor-card-basic .card-header { background-color: #0d6efd30; }
.vendor-card-contact .card-header { background-color: #19875430; }
.vendor-card-financial .card-header { background-color: #ffc10730; }
.vendor-card-additional .card-header { background-color: #0dcaf030; }
.vendor-card-attachments .card-header { background-color: #6c757d30; }

/* Line items card */
.vendor-card-lineitems { border-left: 6px solid #6f42c1; }
.vendor-card-lineitems .card-header { background-color: rgba(111,66,193,0.12); }

/* Totals card */
.vendor-card-totals { border-left: 6px solid #fd7e14; }
.vendor-card-totals .card-header { background-color: rgba(253,126,20,0.12); }

/* Attachments card */
.vendor-card-attachments .card-header { background-color: rgba(108,117,125,0.18); }

/* Make card headers stand out a bit */
.vendor-card .card-header { border-bottom: 1px solid rgba(0,0,0,0.05); }

/* Invoice-specific card styles */
.invoice-card.invoice-card-header .card-header { background-color: rgba(13,110,253,0.12); border-left: 6px solid #0d6efd; }
.invoice-card .card-header { padding: 0.75rem 1rem; }
.invoice-card .card-body { padding: 1.25rem; }

/* ===== Modern compact styles for Recompute Reports page ===== */
/* Page container: center and limit width for better reading */
.container.py-4, .container.py-3, .container {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 10px;
    padding-right: 10px;
}

/* Report header: compact two-column layout */
.report-top {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.report-top .description {
    color: #6c757d;
    margin: 0 0 0.15rem 0;
    line-height: 1.2;
    max-width: 62%;
    text-align: right;
    font-size: 0.95rem;
}

.report-top h1, .report-top .description {
    font-family: 'Cairo', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
    font-weight: 500 !important;
}

/* Schedule control: inline small input + button */
.schedule-control {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.schedule-control input[type="number"] {
    width: 72px;
    padding: 0.22rem 0.35rem;
    border-radius: 0.28rem;
    border: 1px solid #ced4da;
    box-shadow: none;
    font-weight: 600;
    text-align: right; /* rtl friendly */
}

.schedule-control button {
    padding: 0.35rem 0.9rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

/* Make the main card slimmer with tighter padding */
.card.shadow-sm {
    padding: 0.04rem;
}
.card.shadow-sm .card-body {
    padding: 0.28rem 0.32rem;
}

/* Compact table styles */
.table {
    margin-bottom: 0;
    font-size: 0.95rem;
}
.table thead th {
    border-bottom: 2px solid #e9ecef;
    font-weight: 700;
    color: #213547;
    background: transparent;
}
.table tbody td {
    padding: 0.5rem 0.6rem;
    vertical-align: middle;
    border-top: 1px solid rgba(0,0,0,0.04);
}

/* Reduce row height on small screens */
@media (max-width: 768px) {
    .table tbody td { padding: 0.5rem; font-size: 0.92rem; }
    .report-top .description { max-width: 100%; }
}

/* Action button style (View) compact pill */
.btn-outline-primary {
    border-radius: 0.45rem;
    padding: 0.32rem 0.6rem;
}

/* Accent left border for the reports card to make it modern */
.reports-card {
    border-left: 6px solid rgba(13,110,253,0.12);
}

/* Toasts: smaller, sharper corners */
.toast {
    border-radius: 0.5rem;
}

/* Page section titles styling */
.content-wrapper h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

/* Tweak live-clock badge to be more subtle */
.navbar .live-clock-badge {
    padding: 0.15rem 0.5rem;
}

/* Smaller footer spacing for the report details panel */
#reportDetails .card-body { padding: 0.8rem; }

/* Improve focus outline for inputs */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(13,110,253,0.12);
    border-color: #0d6efd;
}

/* Subtle row hover increase */
.table tbody tr:hover { background: rgba(13,110,253,0.02); }

/* Make table header sticky on scroll for long lists */
.table thead th { position: sticky; top: 0; z-index: 1; }

/* Collapsible small details for updated records area */
.updated-records { max-height: 320px; overflow: auto; }

/* Reduce default card shadow on large screens for a flatter modern look */
@media (min-width: 992px) {
    .card { box-shadow: 0 6px 18px rgba(8,41,68,0.06); }
}

/* Provide a subtle color palette for report badges */
.badge-report { background-color: #eef6ff; color: #083a72; font-weight: 600; border-radius: 999px; padding: 0.25rem 0.6rem; }

/* Ensure schedule small helper text is subtle */
.form-text { color: #6c757d; }

/* End modern compact styles */

/* Reports card-list modern design */
.reports-grid {
    display: block; /* use stacked list for compact view */
    gap: 0.35rem;
    margin-top: 0.4rem;
    direction: rtl; /* ensure cards align to right for Arabic */
}

@media (min-width: 1000px) {
    .reports-grid { grid-template-columns: repeat(2, 1fr); }
}

.report-card {
    border-radius: 0.45rem;
    overflow: hidden;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    border: 1px solid rgba(13,110,253,0.035);
    margin: 0; /* remove extra spacing */
}
.report-card:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(8,41,68,0.04); }

/* Ensure RTL alignment inside cards */
.report-card { direction: rtl; text-align: right; width:100%; }
.report-card .card-header { flex-direction: row-reverse; text-align: right; display:flex; align-items:center; justify-content:space-between; padding:0.32rem 0.45rem; }

.report-card .card-header .rc-date { font-weight:700; color:#083a72; font-size:0.92rem; text-align:right; }
.report-card .card-header .rc-badge { background:#eef6ff; color:#083a72; padding:0.14rem 0.3rem; border-radius:999px; font-size:0.78rem; text-align:center; }

.report-card .card-body { padding:0.28rem 0.32rem; }
.report-stats { display:flex; gap:0.28rem; align-items:flex-start; justify-content:flex-end; }
.report-stat { flex:1; text-align:right; padding:0.12rem 0.18rem; border-left:1px solid rgba(0,0,0,0.03); }
.report-stat:last-child { border-left:none; }
.report-stat .label { display:block; font-size:0.78rem; color:#6c757d; text-align:right; }
.report-stat .value { font-weight:700; font-size:0.98rem; margin-top:0.12rem; text-align:right; }

.report-actions { display:flex; gap:0.32rem; justify-content:flex-end; margin-top:0.18rem; }

/* Tighten overall card spacing */
.report-card + .report-card { margin-top: 0.28rem; }

/* Small screens: single column */
@media (max-width: 576px) {
    .reports-grid { grid-template-columns: 1fr; }
}

/* Force Cairo globally as a last-resort override so all pages use the intended Arabic font */
html, body {
    font-family: 'Cairo', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif !important;
}

/* ===== Mobile Responsive Styles ===== */

/* Navbar mobile improvements */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0;
        background-color: rgba(0, 0, 0, 0.2);
        border: none;
        box-shadow: none;
    }
    
    .navbar-nav .dropdown-item {
        padding: 0.5rem 2rem;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .navbar-nav .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    /* User dropdown on mobile */
    .navbar-nav.ms-auto {
        margin-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
    }
    
    .navbar-nav .nav-item.dropdown .nav-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .navbar-nav .nav-item.dropdown .nav-link span {
        max-width: 100% !important;
    }
    
    /* Clock badge on mobile */
    .navbar .live-clock-badge {
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0;
        padding: 0.5rem 1rem;
    }
    
    /* Avatar size on mobile */
    .navbar-nav .nav-item.dropdown .nav-link img,
    .navbar-nav .nav-item.dropdown .nav-link span.bg-light {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Content wrapper mobile padding */
@media (max-width: 767.98px) {
    .content-wrapper {
        padding: 10px;
    }
    
    .content-wrapper h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}

/* Page headers mobile layout */
@media (max-width: 767.98px) {
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .d-flex.justify-content-between.align-items-center h1 {
        margin-bottom: 0;
        width: 100%;
    }
    
    .d-flex.justify-content-between.align-items-center > a,
    .d-flex.justify-content-between.align-items-center > div {
        width: 100%;
    }
    
    .d-flex.justify-content-between.align-items-center > a.btn,
    .d-flex.justify-content-between.align-items-center > div > a.btn {
        width: 100%;
        justify-content: center;
    }
}

/* Tables mobile responsive */
@media (max-width: 767.98px) {
    .table-responsive {
        border: none;
        margin-top: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.75rem;
        background-color: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .table tbody td:last-child {
        border-bottom: none;
    }
    
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #495057;
        margin-inline-end: 1rem;
        flex-shrink: 0;
    }
    
    /* Hide action buttons group wrapper on mobile, show buttons stacked */
    .table tbody td .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .table tbody td .btn-group .btn,
    .table tbody td .btn-group form {
        width: 100%;
        margin: 0;
    }
    
    .table tbody td .btn-group .btn {
        justify-content: center;
    }
    
    /* For action columns, stack buttons vertically */
    .table tbody td[data-label*="Actions"],
    .table tbody td[data-label*="الإجراءات"] {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table tbody td[data-label*="Actions"]::before,
    .table tbody td[data-label*="الإجراءات"]::before {
        margin-bottom: 0.5rem;
    }
}

/* Forms mobile responsive */
@media (max-width: 767.98px) {
    .card-body .row.g-3 > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control,
    .input-group .btn {
        width: 100%;
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
    }
    
    .input-group .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Filter forms */
    .card-body form.row.g-3 {
        margin: 0;
    }
    
    .card-body form.row.g-3 > [class*="col-"] {
        padding: 0;
        margin-bottom: 0.75rem;
    }
    
    .card-body form.row.g-3 > [class*="col-"]:last-child {
        margin-bottom: 0;
    }
}

/* Buttons mobile */
@media (max-width: 767.98px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    /* Language selector buttons: keep on same line on mobile */
    .btn-group[aria-label="Language selector"] {
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: auto !important;
        justify-content: center;
        margin: 0 auto;
    }
    
    .btn-group[aria-label="Language selector"] .btn {
        width: auto !important;
        margin-bottom: 0 !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        border-radius: 0.375rem !important;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Action buttons in table rows */
    .sales-row-actions,
    .btn-group[role="group"] {
        flex-direction: column;
        width: 100%;
    }
    
    /* Exception: Language selector buttons stay on same line */
    .btn-group[role="group"][aria-label="Language selector"] {
        flex-direction: row !important;
        width: auto !important;
    }
    
    .btn-group[role="group"][aria-label="Language selector"] .btn {
        width: auto !important;
        margin: 0 !important;
    }
    
    .sales-row-actions .btn,
    .btn-group[role="group"] .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    /* Forms with inline buttons */
    form[style*="display: inline"] {
        display: block !important;
        width: 100%;
    }
    
    form[style*="display: inline"] button {
        width: 100%;
    }
}

/* Cards mobile */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Pagination mobile */
@media (max-width: 767.98px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-item {
        margin: 0.25rem;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Search and filter sections mobile */
@media (max-width: 767.98px) {
    .card.mb-4 {
        margin-bottom: 1rem !important;
    }
    
    /* Search input with button */
    .input-group > input.form-control {
        border-radius: 0.375rem 0.375rem 0 0 !important;
    }
    
    .input-group > button.btn {
        border-radius: 0 0 0.375rem 0.375rem !important;
    }
}

/* Tenant context banner mobile */
@media (max-width: 767.98px) {
    #tenantContextBanner .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Dropdown menus mobile */
@media (max-width: 767.98px) {
    .dropdown-menu {
        max-width: 100%;
        width: 100%;
    }
    
    .dropdown-menu.dropdown-menu-end {
        right: 0;
        left: 0;
    }
}

/* Select2 mobile */
@media (max-width: 767.98px) {
    .select2-container {
        width: 100% !important;
    }
}

/* Print button and action buttons in header */
@media (max-width: 767.98px) {
    .d-flex.align-items-center[style*="gap"] {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem !important;
    }
    
    .d-flex.align-items-center[style*="gap"] > * {
        width: 100%;
    }
    
    .d-flex.align-items-center[style*="gap"] input.form-control {
        width: 100%;
        max-width: 100% !important;
    }
}

/* Fix for RTL on mobile */
@media (max-width: 767.98px) {
    html[dir="rtl"] .table tbody td {
        flex-direction: row-reverse;
    }
    
    html[dir="rtl"] .table tbody td::before {
        margin-inline-start: 1rem;
        margin-inline-end: 0;
    }
}

/* Improve touch targets on mobile */
@media (max-width: 767.98px) {
    .btn,
    .nav-link,
    .dropdown-item,
    .page-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Hide less important elements on very small screens */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .content-wrapper h1 {
        font-size: 1.25rem;
    }
    
    .table tbody td {
        font-size: 0.8125rem;
    }
    
    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* View pages mobile responsive */
@media (max-width: 767.98px) {
    /* View page headers with buttons */
    .d-flex.justify-content-between.align-items-center .btn-group {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .d-flex.justify-content-between.align-items-center .btn-group .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Multiple buttons in header */
    .d-flex.align-items-center.gap-2 {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem !important;
    }
    
    .d-flex.align-items-center.gap-2 > * {
        width: 100%;
    }
    
    .d-flex.align-items-center.gap-2 .btn,
    .d-flex.align-items-center.gap-2 form {
        width: 100%;
    }
    
    .d-flex.align-items-center.gap-2 form button {
        width: 100%;
    }
    
    /* Two column layouts in view pages */
    .row > [class*="col-md-"] {
        margin-bottom: 1rem;
    }
    
    /* Statistics cards in view pages */
    .row.text-center .col-6 {
        margin-bottom: 1rem;
    }
    
    .row.text-center .col-6 .border-end {
        border-right: none !important;
        border-bottom: 1px solid #dee2e6;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Card headers with buttons */
    .card-header.d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .card-header.d-flex.justify-content-between.align-items-center .btn {
        width: 100%;
    }
    
    /* Tables in view pages */
    .table.table-borderless th {
        width: 100% !important;
        display: block;
        font-weight: 700;
        margin-top: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .table.table-borderless th:first-child {
        margin-top: 0;
    }
    
    .table.table-borderless td {
        display: block;
        padding: 0 0 0.5rem 0;
        border: none;
    }
    
    /* Small tables in cards */
    .table.table-sm {
        font-size: 0.875rem;
    }
    
    .table.table-sm thead {
        display: none;
    }
    
    .table.table-sm tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.75rem;
        background-color: #fff;
    }
    
    .table.table-sm tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .table.table-sm tbody td:last-child {
        border-bottom: none;
    }
    
    .table.table-sm tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #495057;
        margin-inline-end: 1rem;
        flex-shrink: 0;
    }
    
    /* Alert boxes */
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .alert ul {
        padding-inline-start: 1.5rem;
        margin-top: 0.5rem;
    }
    
    .alert li {
        margin-bottom: 0.25rem;
    }
}

/* Form pages mobile responsive */
@media (max-width: 767.98px) {
    /* Form container */
    .row.justify-content-center .col-md-8,
    .row.justify-content-center .col-md-6 {
        padding: 0;
    }
    
    /* Form rows */
    .row > [class*="col-md-"],
    .row > [class*="col-"] {
        margin-bottom: 1rem;
        padding: 0;
    }
    
    /* Form labels */
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    /* Form inputs */
    .form-control,
    .form-select,
    .select2-container {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    /* Form buttons */
    .card-body form .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .card-body form .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .card-body form .btn-group .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Form action buttons */
    .d-grid.gap-2.d-md-flex.justify-content-md-end {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .d-grid.gap-2.d-md-flex.justify-content-md-end .btn {
        width: 100%;
    }
    
    /* Nested cards in forms (vendor forms) */
    .card.mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .vendor-card .card-body .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
}

/* Modals mobile responsive */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-header .btn-close {
        align-self: flex-end;
        margin-top: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-body .row .col-sm-4,
    .modal-body .row .col-sm-8 {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .modal-body dl.row dt {
        margin-bottom: 0.25rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* Toasts mobile responsive */
@media (max-width: 767.98px) {
    #globalToastContainer {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        bottom: auto !important;
        padding: 0.5rem !important;
        max-width: 100% !important;
        z-index: 9999 !important;
    }
    
    .toast {
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    .toast-body {
        padding: 0.75rem;
        font-size: 0.875rem;
        word-wrap: break-word;
    }
    
    .toast .btn-close {
        margin: 0.5rem;
    }
}

/* SweetAlert2 mobile responsive */
@media (max-width: 767.98px) {
    .swal2-popup {
        width: 90% !important;
        max-width: 90% !important;
        padding: 1rem !important;
    }
    
    .swal2-title {
        font-size: 1.25rem !important;
        padding: 0.5rem 0 !important;
    }
    
    .swal2-content {
        font-size: 0.875rem !important;
        padding: 0.5rem 0 !important;
    }
    
    .swal2-actions {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .swal2-actions button {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .swal2-html-container {
        font-size: 0.875rem !important;
    }
}

/* Alerts mobile responsive */
@media (max-width: 767.98px) {
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    .alert strong {
        display: block;
        margin-bottom: 0.5rem;
    }
    
    .alert ul {
        margin-top: 0.5rem;
        padding-inline-start: 1.5rem;
    }
    
    .alert li {
        margin-bottom: 0.5rem;
    }
    
    /* Tenant context banner */
    #tenantContextBanner .alert {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Card body tables mobile */
@media (max-width: 767.98px) {
    .card-body .table-responsive {
        margin: 0;
        border: none;
    }
    
    .card-body .table {
        margin-bottom: 0;
    }
}

/* Fix for RTL in view pages */
@media (max-width: 767.98px) {
    html[dir="rtl"] .table.table-borderless th {
        text-align: right;
    }
    
    html[dir="rtl"] .table.table-borderless td {
        text-align: right;
    }
    
    html[dir="rtl"] .table.table-sm tbody td {
        flex-direction: row-reverse;
    }
    
    html[dir="rtl"] .table.table-sm tbody td::before {
        margin-inline-start: 1rem;
        margin-inline-end: 0;
    }
    
    html[dir="rtl"] .row.text-center .col-6 .border-end {
        border-right: none;
        border-left: none;
        border-bottom: 1px solid #dee2e6;
    }
}

/* Very small screens adjustments */
@media (max-width: 575.98px) {
    .card-header h5,
    .card-title {
        font-size: 1rem;
    }
    
    .table.table-sm tbody td {
        font-size: 0.8125rem;
    }
    
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .swal2-popup {
        width: 95% !important;
        max-width: 95% !important;
        padding: 0.75rem !important;
    }
}

/* Additional mobile fixes for specific pages */
@media (max-width: 767.98px) {
    /* Settings users page */
    .table.table-striped tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.75rem;
        background-color: #fff;
    }
    
    .table.table-striped tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .table.table-striped tbody td:last-child {
        border-bottom: none;
    }
    
    .table.table-striped tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #495057;
        margin-inline-end: 1rem;
        flex-shrink: 0;
    }
    
    .table.table-striped tbody td .d-inline-flex {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .table.table-striped tbody td .d-inline-flex .btn,
    .table.table-striped tbody td .d-inline-flex form {
        width: 100%;
    }
    
    /* Dashboard statistics cards */
    .row .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* Dashboard quick actions */
    .quick-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .quick-actions .btn {
        width: 100%;
    }
    
    /* Sales view page action buttons */
    .sales-action-buttons {
        flex-direction: column !important;
        width: 100%;
        gap: 0.5rem !important;
    }
    
    .sales-action-buttons .btn,
    .sales-action-buttons form {
        width: 100%;
        margin: 0 !important;
    }
    
    /* Vendor actions */
    .vendor-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .vendor-actions .btn,
    .vendor-actions form {
        width: 100%;
        margin: 0 !important;
    }
    
    /* Employee view buttons */
    .d-flex.justify-content-between.align-items-center > div {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .d-flex.justify-content-between.align-items-center > div > * {
        width: 100%;
    }
    
    /* Inline forms in buttons */
    form[style*="display:inline-block"],
    form[style*="display: inline-block"],
    form[style*="display:inline"] {
        display: block !important;
        width: 100%;
        margin: 0 !important;
    }
    
    form[style*="display:inline-block"] button,
    form[style*="display: inline-block"] button,
    form[style*="display:inline"] button {
        width: 100%;
    }
    
    /* Payment form buttons */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .d-flex.justify-content-between > * {
        width: 100%;
    }
    
    /* Index page tables */
    .index-page .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.75rem;
    }
    
    .index-page .table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .index-page .table tbody td:last-child {
        border-bottom: none;
    }
    
    .index-page .table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        margin-inline-end: 1rem;
    }
    
    /* Workshop form - line items mobile responsiveness */
    .line-item {
        padding: 1rem !important;
    }
    
    .line-item .row {
        flex-direction: column;
    }
    
    .line-item .row > div {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 1rem;
    }
    
    .line-item .row > div:last-child {
        margin-bottom: 0;
    }
    
    .line-item .col-md-1,
    .line-item .col-md-2,
    .line-item .col-md-3 {
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Workshop form - card header buttons */
    .card-header.d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .card-header.d-flex.justify-content-between.align-items-center .btn {
        width: 100%;
    }
    
    /* Workshop form - totals section */
    .totals-section .row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .totals-section .col-md-3 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1rem 0 !important;
    }
    
    .totals-section .col-md-3:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Workshop form - action buttons */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .d-flex.justify-content-between > * {
        width: 100%;
    }
    
    /* Workshop update form - fields */
    #material-fields .row,
    #service-fields .row,
    #other-fields .row {
        flex-direction: column;
    }
    
    #material-fields .col-md-3,
    #service-fields .col-md-3,
    #other-fields .col-md-6 {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
    
    #material-fields .col-md-3:last-child,
    #service-fields .col-md-3:last-child {
        margin-bottom: 0;
    }
    
    /* Workshop update form - workshop information card */
    .card.mt-4 .row {
        flex-direction: column;
    }
    
    .card.mt-4 .col-md-6 {
        width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .card.mt-4 .col-md-6:last-child {
        margin-bottom: 0;
    }
    
    /* Workshop form - main form fields */
    .container-fluid .row.justify-content-center .col-md-8 {
        padding: 0.5rem;
    }
    
    .container-fluid .row .col-md-4 {
        width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .container-fluid .row .col-md-4:last-child {
        margin-bottom: 0;
    }
    
    /* Workshop form - description textarea */
    textarea.form-control {
        min-height: 80px !important;
    }
    
    /* Workshop form - remove button */
    .line-item .btn-danger.btn-sm {
        width: 100%;
        margin-top: 0 !important;
        padding: 0.5rem;
    }
    
    /* Workshop form - line total field */
    .line-item .line-total {
        font-weight: 600;
    }
    
    /* Catalog page mobile responsiveness */
    .catalog-page .catalog-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .catalog-page .catalog-title {
        font-size: 1.25rem;
        margin-bottom: 0;
    }
    
    .catalog-page .catalog-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .catalog-page .catalog-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .catalog-page .catalog-actions form {
        width: 100%;
        flex-wrap: wrap;
    }
    
    /* Catalog images grid - mobile */
    .catalog-page .row.g-3 {
        margin: 0;
    }
    
    .catalog-page .col-12.col-sm-6.col-lg-3 {
        padding: 0.5rem;
    }
    
    .catalog-page .card {
        margin-bottom: 0.5rem;
    }
    
    .catalog-page .card-body {
        height: 200px !important;
    }
    
    /* Catalog checkbox - mobile */
    .catalog-page .card label {
        z-index: 10 !important;
        padding: 0.5rem !important;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .catalog-page .card .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
        cursor: pointer;
    }
    
    /* Catalog viewer modal - mobile */
    .catalog-viewer-modal {
        padding: 0.5rem;
        touch-action: pan-y pinch-zoom;
    }
    
    .catalog-modal-image {
        max-width: 100% !important;
        max-height: calc(100vh - 1rem) !important;
        width: auto;
        height: auto;
        touch-action: pan-y pinch-zoom;
    }
    
    /* Prevent text selection on mobile when swiping */
    .catalog-viewer-modal * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
}

/* Catalog navigation buttons - desktop and mobile */
.catalog-nav-btn {
    transition: all 0.3s ease;
}

.catalog-nav-btn:hover {
    background: rgba(0,0,0,0.8) !important;
    transform: scale(1.1);
}

.catalog-nav-btn:active {
    transform: scale(0.95);
}

@media (max-width: 767.98px) {
    /* Catalog navigation buttons - mobile */
    .catalog-nav-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px;
        min-height: 44px;
        font-size: 20px !important;
    }
    
    .catalog-modal-nav {
        padding: 0 0.5rem !important;
    }
    
    .catalog-nav-close {
        top: 0.5rem !important;
        right: 0.5rem !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 24px !important;
    }
    
    /* Catalog export modal - mobile */
    .catalog-export-modal {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 1rem !important;
        margin: 1rem;
    }
    
    .catalog-export-modal h5 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .catalog-export-modal .form-check {
        margin-bottom: 0.75rem;
    }
    
    .catalog-export-modal .d-flex.justify-content-end {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .catalog-export-modal .d-flex.justify-content-end .btn {
        width: 100%;
    }
    
    /* Catalog search page - mobile */
    .catalog-search-page {
        padding: 0.5rem !important;
    }
    
    .catalog-search-page .card {
        margin: 0;
        border-radius: 0.5rem;
    }
    
    .catalog-search-page .card-body {
        padding: 1rem;
    }
    
    .catalog-search-page h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .catalog-search-page p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .catalog-search-page .row.g-3 {
        flex-direction: column;
        margin: 0;
    }
    
    .catalog-search-page .row.g-3 > [class*="col-"] {
        padding: 0;
        margin-bottom: 1rem;
    }
    
    .catalog-search-page .col-md-8,
    .catalog-search-page .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Select2 on catalog search page - mobile */
    .catalog-search-page .select2-container {
        width: 100% !important;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .catalog-search-page .select2-container--bootstrap-5 .select2-selection {
        min-height: 44px; /* Better touch target */
        padding: 0.5rem 0.75rem;
        font-size: 16px;
    }
    
    .catalog-search-page .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
        line-height: 1.5;
        padding-right: 2rem;
        font-size: 16px;
    }
    
    .catalog-search-page .select2-container--bootstrap-5 .select2-dropdown {
        font-size: 16px;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .catalog-search-page .select2-container--bootstrap-5 .select2-results__option {
        padding: 0.75rem 0.5rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        font-size: 16px;
    }
    
    .catalog-search-page .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem !important;
        margin-top: 0.5rem;
    }
    
    .catalog-search-page .d-flex.gap-2 .btn {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .catalog-search-page .d-flex.gap-2 .btn i {
        font-size: 1.1rem;
    }
}

/* End Mobile Responsive Styles */

/* ===== تجاوز قوي لألوان الأزرار - يجب أن يكون في النهاية ===== */

/* Primary buttons - Blue */
.btn.btn-primary,
button.btn-primary,
a.btn-primary,
.btn-primary.btn,
.btn-primary.text-white,
.btn-primary.rounded {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary:active,
button.btn-primary:hover,
a.btn-primary:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
    color: #ffffff !important;
}

/* Success buttons - Green */
.btn.btn-success,
button.btn-success,
a.btn-success,
.btn-success.btn,
.btn-success.text-white,
.btn-success.rounded {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

.btn.btn-success:hover,
.btn.btn-success:focus,
.btn.btn-success:active,
button.btn-success:hover,
a.btn-success:hover {
    background-color: #157347 !important;
    border-color: #146c43 !important;
    color: #ffffff !important;
}

/* Danger buttons - Red */
.btn.btn-danger,
button.btn-danger,
a.btn-danger,
.btn-danger.btn,
.btn-danger.text-white,
.btn-danger.rounded {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.btn.btn-danger:hover,
.btn.btn-danger:focus,
.btn.btn-danger:active,
button.btn-danger:hover,
a.btn-danger:hover {
    background-color: #bb2d3b !important;
    border-color: #b02a37 !important;
    color: #ffffff !important;
}

/* Warning buttons - Yellow */
.btn.btn-warning,
button.btn-warning,
a.btn-warning,
.btn-warning.btn,
.btn-warning.text-dark,
.btn-warning.rounded {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000000 !important;
}

.btn.btn-warning:hover,
.btn.btn-warning:focus,
.btn.btn-warning:active,
button.btn-warning:hover,
a.btn-warning:hover {
    background-color: #ffca2c !important;
    border-color: #ffc720 !important;
    color: #000000 !important;
}

/* Info buttons - Cyan */
.btn.btn-info,
button.btn-info,
a.btn-info,
.btn-info.btn,
.btn-info.text-white,
.btn-info.text-dark,
.btn-info.rounded {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000000 !important;
}

.btn.btn-info:hover,
.btn.btn-info:focus,
.btn.btn-info:active,
button.btn-info:hover,
a.btn-info:hover {
    background-color: #31d2f2 !important;
    border-color: #25cff2 !important;
    color: #000000 !important;
}

/* Secondary buttons - Gray */
.btn.btn-secondary,
button.btn-secondary,
a.btn-secondary,
.btn-secondary.btn,
.btn-secondary.text-white,
.btn-secondary.rounded {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.btn.btn-secondary:hover,
.btn.btn-secondary:focus,
.btn.btn-secondary:active,
button.btn-secondary:hover,
a.btn-secondary:hover {
    background-color: #5c636a !important;
    border-color: #565e64 !important;
    color: #ffffff !important;
}

/* Outline buttons */
.btn.btn-outline-primary,
a.btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: transparent !important;
}

.btn.btn-outline-primary:hover,
a.btn-outline-primary:hover {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.btn.btn-outline-secondary,
a.btn-outline-secondary {
    color: #6c757d !important;
    border-color: #6c757d !important;
    background-color: transparent !important;
}

.btn.btn-outline-secondary:hover,
a.btn-outline-secondary:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

/* إخفاء النص التوضيحي الافتراضي للمتصفح */
.btn[title],
button[title],
a.btn[title] {
    position: relative;
}

/* إلغاء عرض tooltip الافتراضي */
.btn[title]:hover::after,
button[title]:hover::after,
a.btn[title]:hover::after,
.btn[title]:hover::before,
button[title]:hover::before,
a.btn[title]:hover::before {
    display: none !important;
    content: none !important;
}


/* Print Styles - Hide elements that shouldn't appear in print */
@media print {
    /* Hide subscription notifications */
    .no-print {
        display: none !important;
    }
    
    /* Hide navigation and action buttons */
    .navbar,
    .action-buttons,
    .btn-group,
    button:not(.print-only),
    .alert.no-print {
        display: none !important;
    }
}


/* Fix for emoji rendering issues - force Font Awesome icons */
.btn i.fas,
.btn i.far,
.btn i.fab {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Hide any remaining emoji characters that might appear as boxes */
.btn::before,
.btn::after {
    content: none !important;
}

/* Ensure proper icon display */
i.fas::before,
i.far::before,
i.fab::before {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}


/* Force Font Awesome to load and display correctly */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    font-display: block;
}

/* Ensure Font Awesome icons display properly */
.fas, .far, .fab, .fa {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Fix for icons not showing - force font family */
i.fas::before,
i.far::before,
i.fab::before,
i.fa::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
    font-weight: 900;
}

/* Specific fix for navbar and headers */
.navbar i.fas,
.card-header i.fas,
h1 i.fas,
h2 i.fas,
h3 i.fas,
h4 i.fas,
h5 i.fas {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}
