﻿/* Custom Styles for Machinery Maintenance System */

/* تصغير حجم الصفحة العام إلى 90% (يؤثر على كل شيء: خطوط، padding، صور، عناصر ثابتة) */
html {
    zoom: 0.9;
}

:root {
    /* Branding Colors extracted from Company Logo */
    --brand-dark: #2C313F;    /* The dark background color */
    --brand-orange: #C55A11;  /* The logo accent color */
    --brand-light-orange: #E06C20; /* Lighter shade for hover */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* --- Brand Overrides --- */

/* Navbar Customization */
.navbar {
    background-color: var(--brand-dark) !important;
    color: white !important;
}

.navbar .nav-link, .navbar .navbar-brand {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar .nav-link:hover, .navbar .nav-link.active {
    color: var(--brand-orange) !important;
}

.navbar .dropdown-menu {
    border-top: 3px solid var(--brand-orange);
}

.navbar .dropdown-item:hover {
    background-color: #f0f0f0;
    color: var(--brand-orange);
}

/* Primary Button Override (Bootstrap Blue to Brand Orange) */
.btn-primary {
    background-color: var(--brand-orange) !important;
    border-color: var(--brand-orange) !important;
}

.btn-primary:hover {
    background-color: var(--brand-light-orange) !important;
    border-color: var(--brand-light-orange) !important;
}

.btn-outline-primary {
    color: var(--brand-orange) !important;
    border-color: var(--brand-orange) !important;
}

.btn-outline-primary:hover {
    background-color: var(--brand-orange) !important;
    color: white !important;
}

/* Text Colors */
.text-primary {
    color: var(--brand-orange) !important;
}

/* Card Icons */
.stats-icon {
    background-color: rgba(197, 90, 17, 0.1); /* transparent orange */
    color: var(--brand-orange);
}

/* Loader */
.stats-card .fa-spinner {
    color: var(--brand-orange) !important;
}

/* Backgrounds & Borders */
.bg-primary {
    background-color: var(--brand-orange) !important;
}

.border-primary {
    border-color: var(--brand-orange) !important;
}

/* Pagination */
.page-item.active .page-link {
    background-color: var(--brand-orange) !important;
    border-color: var(--brand-orange) !important;
}

.page-link {
    color: var(--brand-orange) !important;
}

/* Form Controls Focus */
.form-control:focus, .form-select:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 0.25rem rgba(197, 90, 17, 0.25);
}

/* SB Admin 2 Utility Overrides */
.border-left-primary {
    border-left: 0.25rem solid var(--brand-orange) !important;
}

.text-primary {
    color: var(--brand-orange) !important;
}

/* Button Overrides */
.btn-info {
    background-color: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
    color: #fff !important;
}

.btn-info:hover {
    background-color: #1a1d25 !important;
    border-color: #1a1d25 !important;
}

/* Table Actions adjustments */
.table .btn {
    margin: 0 2px;
}

/* Table Head */
.table-primary {
    --bs-table-bg: rgba(197, 90, 17, 0.1);
    --bs-table-border-color: rgba(197, 90, 17, 0.2);
}

/* ----------------------- */

/* ط§ظ†ظٹظ…ظٹط´ظ† ظ„ظ„طھط­ط¯ظٹط« ط§ظ„ط³ط±ظٹط¹ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.25rem;
}

.stats-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stats-card h3 {
    transition: opacity 0.3s ease-in-out, color 0.2s ease-in-out;
}

.stats-card .fa-spinner {
    animation: pulse 1.5s ease-in-out infinite;
    /* Color handled by override above */
}

.stats-card:hover {
    transform: translateY(-2px);
}

.stats-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Disabled Navigation Links */
.nav-link.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    color: #6c757d !important;
}

.nav-link.disabled:hover {
    background-color: transparent !important;
}

.nav-link.disabled i {
    color: #6c757d !important;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #1e7e34;
    border-color: #1e7e34;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: bold;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.alert {
    border-radius: 10px;
    border: none;
}

.modal-content {
    border-radius: 10px;
}

footer {
    margin-top: auto;
}

/* RTL Support */
[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .d-flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .ms-3 {
    margin-left: 0;
    margin-right: 1rem;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Smooth data transitions */
.stats-card h3 {
    transition: all 0.4s ease-in-out;
}

.stats-card h3.loading {
    opacity: 0.7;
    transform: scale(0.95);
}

.stats-card h3.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-card .d-flex {
        flex-direction: column;
        text-align: center;
    }

    .stats-icon {
        margin-bottom: 10px;
    }

    .navbar-brand {
        font-size: 1rem;
    }
}

/* Dashboard Quick Action Cards */
.dashboard-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
    background: white;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    color: inherit;
}

.dashboard-card .card-body {
    padding: 1.5rem;
    text-align: center;
}

.dashboard-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    transition: all 0.3s ease;
}

.dashboard-card:hover .dashboard-icon-wrapper {
    background-color: #0d6efd;
    color: white;
}

.dashboard-card h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Navbar Active State */
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff !important;
    font-weight: bold;
    border-bottom: 2px solid #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* Navbar Light Active State */
.navbar-light .navbar-nav .nav-link.active {
    color: #0d6efd !important;
    font-weight: bold;
    border-bottom: 2px solid #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 5px;
}

/* Dark Mode Toggle Hover */
#darkModeToggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(15deg);
    transition: all 0.3s ease;
}

/* Table Improvements */
.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05) !important;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 20px;
    left: 20px; /* RTL layout */
    display: none;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #0d6efd;
    color: white;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#backToTop:hover {
    background-color: #0b5ed7;
    transform: translateY(-3px);
}

/* Custom Colors for Dashboard Icons */
.icon-primary { background-color: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.dashboard-card:hover .icon-primary { background-color: #0d6efd; color: white; }

.icon-success { background-color: rgba(25, 135, 84, 0.1); color: #198754; }
.dashboard-card:hover .icon-success { background-color: #198754; color: white; }

.icon-warning { background-color: rgba(255, 193, 7, 0.1); color: #ffc107; }
.dashboard-card:hover .icon-warning { background-color: #ffc107; color: white; }

.icon-info { background-color: rgba(13, 202, 240, 0.1); color: #0dcaf0; }
.dashboard-card:hover .icon-info { background-color: #0dcaf0; color: white; }

.icon-danger { background-color: rgba(220, 53, 69, 0.1); color: #dc3545; }
.dashboard-card:hover .icon-danger { background-color: #dc3545; color: white; }

.icon-purple { background-color: rgba(111, 66, 193, 0.1); color: #6f42c1; }
.dashboard-card:hover .icon-purple { background-color: #6f42c1; color: white; }

/* =========================================
   Dark Mode Styles
   ========================================= */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .card, 
body.dark-mode .stats-card,
body.dark-mode .dashboard-card {
    background-color: #1e1e1e;
    color: #e0e0e0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

body.dark-mode .card-header {
    background-color: #2d2d2d;
    border-bottom: 1px solid #404040;
    color: #ffffff;
}

body.dark-mode .table {
    color: #e0e0e0;
}

body.dark-mode .table th {
    background-color: #2d2d2d;
    color: #ffffff;
    border-color: #404040;
}

body.dark-mode .table td {
    border-color: #404040;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #333333;
    border-color: #0d6efd;
    color: #ffffff;
}

body.dark-mode .dropdown-menu {
    background-color: #1e1e1e;
    border-color: #404040;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #2d2d2d;
    color: #ffffff;
}

body.dark-mode .footer {
    background-color: #1e1e1e !important;
    color: #adb5bd !important;
}

body.dark-mode .text-muted {
    color: #adb5bd !important;
}

body.dark-mode .modal-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: #404040;
}

body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-mode .list-group-item {
    background-color: #1e1e1e;
    border-color: #404040;
    color: #e0e0e0;
}

/* Dark mode specific overrides for dashboard icons */
body.dark-mode .dashboard-icon-wrapper {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .dashboard-card:hover .dashboard-icon-wrapper {
    color: white;
}/ *   M o b i l e   R e s p o n s i v e n e s s   I m p r o v e m e n t s   * / 
 
 @ m e d i a   ( m a x - w i d t h :   7 6 8 p x )   { 
 
         / *   N a v b a r   I m p r o v e m e n t s   * / 
 
         . n a v b a r - c o l l a p s e   { 
 
                 b a c k g r o u n d :   w h i t e ; 
 
                 p a d d i n g :   1 0 p x ; 
 
                 b o r d e r - r a d i u s :   0   0   1 0 p x   1 0 p x ; 
 
                 b o x - s h a d o w :   0   4 p x   6 p x   r g b a ( 0 , 0 , 0 , 0 . 1 ) ; 
 
                 z - i n d e x :   1 0 5 0 ; 
 
         } 
 
         
 
         . n a v b a r - n a v   . n a v - i t e m   { 
 
                 b o r d e r - b o t t o m :   1 p x   s o l i d   # e e e ; 
 
                 p a d d i n g :   5 p x   0 ; 
 
         } 
 
 
 
         . n a v b a r - n a v   . n a v - i t e m : l a s t - c h i l d   { 
 
                 b o r d e r - b o t t o m :   n o n e ; 
 
         } 
 
 
 
         / *   C a r d s   a d j u s t m e n t s   * / 
 
         . s t a t s - c a r d   { 
 
                 m a r g i n - b o t t o m :   1 5 p x ; 
 
         } 
 
 
 
         / *   T a b l e   t o   C a r d   V i e w   ( f o r   t a b l e s   n o t   u s i n g   D a t a T a b l e s   o r   a s   a   f a l l b a c k )   * / 
 
         . t a b l e - m o b i l e - c a r d s   t h e a d   { 
 
                 d i s p l a y :   n o n e ; 
 
         } 
 
 
 
         . t a b l e - m o b i l e - c a r d s   t b o d y   t r   { 
 
                 d i s p l a y :   b l o c k ; 
 
                 m a r g i n - b o t t o m :   1 r e m ; 
 
                 b a c k g r o u n d :   # f f f ; 
 
                 b o r d e r - r a d i u s :   8 p x ; 
 
                 b o x - s h a d o w :   0   2 p x   4 p x   r g b a ( 0 , 0 , 0 , 0 . 0 5 ) ; 
 
                 b o r d e r :   1 p x   s o l i d   # d e e 2 e 6 ; 
 
                 p a d d i n g :   1 0 p x ; 
 
         } 
 
 
 
         . t a b l e - m o b i l e - c a r d s   t b o d y   t d   { 
 
                 d i s p l a y :   f l e x ; 
 
                 j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
 
                 a l i g n - i t e m s :   c e n t e r ; 
 
                 p a d d i n g :   8 p x   0 ; 
 
                 b o r d e r - b o t t o m :   1 p x   s o l i d   # f 0 f 0 f 0 ; 
 
                 t e x t - a l i g n :   l e f t ;   / *   A l i g n   v a l u e   t o   t h e   l e f t   i n   R T L   * / 
 
         } 
 
 
 
         . t a b l e - m o b i l e - c a r d s   t b o d y   t d : l a s t - c h i l d   { 
 
                 b o r d e r - b o t t o m :   n o n e ; 
 
                 j u s t i f y - c o n t e n t :   c e n t e r ; 
 
                 p a d d i n g - t o p :   1 5 p x ; 
 
         } 
 
 
 
         . t a b l e - m o b i l e - c a r d s   t b o d y   t d : : b e f o r e   { 
 
                 c o n t e n t :   a t t r ( d a t a - l a b e l ) ; 
 
                 f o n t - w e i g h t :   b o l d ; 
 
                 c o l o r :   # 6 6 6 ; 
 
                 m a r g i n - l e f t :   1 0 p x ;   / *   S p a c e   b e t w e e n   l a b e l   a n d   v a l u e   i n   R T L   * / 
 
                 t e x t - a l i g n :   r i g h t ; 
 
                 f l e x - s h r i n k :   0 ; 
 
         } 
 
 
 
         / *   A c t i o n   b u t t o n s   g r o u p i n g   * / 
 
         . p a g e - h e a d e r - a c t i o n s   { 
 
                 p o s i t i o n :   f i x e d ; 
 
                 b o t t o m :   2 0 p x ; 
 
                 l e f t :   2 0 p x ; 
 
                 z - i n d e x :   1 0 0 0 ; 
 
                 d i s p l a y :   f l e x ; 
 
                 f l e x - d i r e c t i o n :   c o l u m n - r e v e r s e ; 
 
                 g a p :   1 0 p x ; 
 
         } 
 
 
 
         . p a g e - h e a d e r - a c t i o n s   . b t n   { 
 
                 b o r d e r - r a d i u s :   5 0 p x ; 
 
                 b o x - s h a d o w :   0   4 p x   8 p x   r g b a ( 0 , 0 , 0 , 0 . 2 ) ; 
 
                 p a d d i n g :   1 0 p x   2 0 p x ; 
 
         } 
 
         
 
         / *   H i d e   o r i g i n a l   t o p   b u t t o n s   c o n t a i n e r   i f   u s i n g   f i x e d   b o t t o m   a c t i o n s   * / 
 
         . d - m o b i l e - n o n e   { 
 
                 d i s p l a y :   n o n e   ! i m p o r t a n t ; 
 
         } 
 
 } 
 
 

/* =========================================
   NEW NEON DARK MODE (Appended Override)
   ========================================= */
body.dark-mode {
    background-color: #0f172a !important; 
    color: #f8fafc !important; 
}

/* Navbar */
body.dark-mode .navbar, 
body.dark-mode .top-navbar {
    background-color: #1e293b !important; 
    border-bottom: 1px solid #334155 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .navbar-brand,
body.dark-mode .nav-link {
    color: #e2e8f0 !important;
}

body.dark-mode .nav-link:hover {
    color: #8b5cf6 !important;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.6) !important;
}

/* Cards */
body.dark-mode .card,
body.dark-mode .stats-card,
body.dark-mode .dashboard-card {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3) !important;
    border-radius: 16px !important;
    transition: all 0.3s ease !important;
}

body.dark-mode .card-header {
    background-color: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
    color: #f8fafc !important;
    font-weight: bold !important;
}

/* Tables */
body.dark-mode .table {
    color: #e2e8f0 !important;
    --bs-table-bg: transparent !important;
}

body.dark-mode .table th {
    background-color: #1e293b !important;
    color: #8b5cf6 !important;
    border-bottom: 2px solid #334155 !important;
    text-transform: uppercase !important;
    border-color: #334155 !important;
}

body.dark-mode .table td {
    border-color: #334155 !important;
    background-color: #1e293b !important;
    vertical-align: middle !important;
}

body.dark-mode .table-hover tbody tr:hover td {
    background-color: #0f172a !important;
    color: #a78bfa !important;
}

/* Forms */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    border-radius: 8px !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #0f172a !important;
    border-color: #8b5cf6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25) !important;
}

/* Modal */
body.dark-mode .modal-content {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 16px !important;
}
body.dark-mode .modal-header { border-bottom: 1px solid #334155 !important; }
body.dark-mode .modal-footer { border-top: 1px solid #334155 !important; }

/* Dropdowns */
body.dark-mode .dropdown-menu {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}
body.dark-mode .dropdown-item { color: #e2e8f0 !important; }
body.dark-mode .dropdown-item:hover { background-color: #334155 !important; color: #a78bfa !important; }

/* Buttons Glow Effects */
body.dark-mode .btn-primary { background: linear-gradient(135deg, #3b82f6, #2563eb) !important; border: none !important; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4) !important; }
body.dark-mode .btn-primary:hover { box-shadow: 0 0 20px rgba(59, 130, 246, 0.6) !important; transform: translateY(-1px); }

body.dark-mode .btn-success { background: linear-gradient(135deg, #10b981, #059669) !important; border: none !important; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important; color: white !important;}
body.dark-mode .btn-success:hover { box-shadow: 0 0 20px rgba(16, 185, 129, 0.6) !important; color: white !important; }

body.dark-mode .btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; border: none !important; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important; color: white !important;}
body.dark-mode .btn-danger:hover { box-shadow: 0 0 20px rgba(239, 68, 68, 0.6) !important; color: white !important;}

/* Dashboard Cards Enhancements */
body.dark-mode .dashboard-card:hover {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4), inset 0 0 10px rgba(139, 92, 246, 0.1) !important;
    transform: translateY(-8px) !important;
}

/* Specific glowing gradients for icons wrappers to mimic cards */
body.dark-mode .dashboard-card .icon-primary { background: linear-gradient(135deg, #3b82f6, #2563eb) !important; color: white !important; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5) !important; }
body.dark-mode .dashboard-card .icon-warning { background: linear-gradient(135deg, #f97316, #ea580c) !important; color: white !important; box-shadow: 0 4px 15px rgba(249, 115, 22, 0.5) !important; }
body.dark-mode .dashboard-card .icon-success { background: linear-gradient(135deg, #10b981, #059669) !important; color: white !important; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5) !important; }
body.dark-mode .dashboard-card .icon-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important; color: white !important; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5) !important; }
body.dark-mode .dashboard-card .icon-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; color: white !important; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5) !important; }
body.dark-mode .dashboard-card .icon-info { background: linear-gradient(135deg, #06b6d4, #0891b2) !important; color: white !important; box-shadow: 0 4px 15px rgba(6, 182, 212, 0.5) !important; }


/* Alerts */
body.dark-mode .alert {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    backdrop-filter: blur(10px) !important;
}

body.dark-mode footer {
    background-color: #1e293b !important;
    border-top: 1px solid #334155 !important;
}





/* =========================================
   NEON DARK MODE - TEXT VISIBILITY FIXES
   ========================================= */

/* Make all standard text light by default in dark mode */
body.dark-mode, 
body.dark-mode p, 
body.dark-mode span:not(.badge), 
body.dark-mode div, 
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6,
body.dark-mode label,
body.dark-mode li {
    color: #f8fafc;
}

/* Force override Bootstrap's text-dark and text-muted in dark mode */
body.dark-mode .text-dark,
body.dark-mode .text-black {
    color: #f8fafc !important;
}
body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

/* -------------------------------------
   DataTables specific fixes
   ------------------------------------- */
/* Fix the text for "Search", "Show entries", "Showing 1 to X of Y entries" */
body.dark-mode .dataTables_wrapper .dataTables_length,
body.dark-mode .dataTables_wrapper .dataTables_filter,
body.dark-mode .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_processing,
body.dark-mode .dataTables_wrapper .dataTables_paginate {
    color: #f8fafc !important;
}

body.dark-mode .dataTables_wrapper .dataTables_length select,
body.dark-mode .dataTables_wrapper .dataTables_filter input {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

/* Pagination buttons */
body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #f8fafc !important;
}
body.dark-mode .page-link {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
body.dark-mode .page-item.active .page-link {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}
body.dark-mode .page-item.disabled .page-link {
    color: #64748b !important;
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

/* -------------------------------------
   Tables Text Fixes
   ------------------------------------- */
body.dark-mode .table {
    --bs-table-color: #f8fafc;
    --bs-table-striped-color: #f8fafc;
    --bs-table-hover-color: #e2e8f0;
    color: #f8fafc !important;
}
body.dark-mode .table td, 
body.dark-mode table.dataTable tbody tr td,
body.dark-mode .table th, 
body.dark-mode table.dataTable thead th {
    color: #f8fafc !important;
}
/* Override alternating row stripe background */
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(255, 255, 255, 0.02) !important;
    color: #f8fafc !important;
}
/* Table Hover Fix */
body.dark-mode .table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #1e293b !important;
    color: #a78bfa !important;
}
/* Ensure table links (like names) are visible */
body.dark-mode .table td a {
    color: #60a5fa !important;
    text-decoration: none;
}
body.dark-mode .table td a:hover {
    color: #93c5fd !important;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

/* -------------------------------------
   Login Page Specific Fixes
   ------------------------------------- */
body.dark-mode .login-page,
body.dark-mode.login-body,
body.dark-mode.bg-light {
    background-color: #0f172a !important;
}
body.dark-mode .login-card,
body.dark-mode .auth-card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.1) !important;
}

/* -------------------------------------
   Input placeholders and select
   ------------------------------------- */
body.dark-mode ::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}
body.dark-mode :-ms-input-placeholder {
    color: #64748b !important;
}
body.dark-mode ::-ms-input-placeholder {
    color: #64748b !important;
}

/* Fix inputs being white on autofill or some backgrounds */
body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover, 
body.dark-mode input:-webkit-autofill:focus, 
body.dark-mode input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0f172a inset !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Any inline styled background fixes */
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color: #ffffff"],
body.dark-mode .bg-white,
body.dark-mode .bg-light {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Icons Fix */
body.dark-mode .input-group-text i {
    color: #a78bfa !important;
}

/* -------------------------------------
   Monthly Schedule & General List Groups
   ------------------------------------- */
body.dark-mode .list-group-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Force dark mode color mapping globally */
:root {
    color-scheme: dark;
}


/* =========================================
   NEON DARK MODE - REMAINING PAGES FIX
   ========================================= */

/* --- 1. Login Page --- */
body.dark-mode .login-container {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.15) !important;
}
body.dark-mode .login-image {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-right: 1px solid #334155 !important;
    color: #f8fafc !important;
}
body.dark-mode .login-form {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}
body.dark-mode .login-form h3, 
body.dark-mode .login-form p {
    color: #f8fafc !important;
}
body.dark-mode .login-form label {
    color: #f8fafc !important;
}
body.dark-mode .modal-content {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}
body.dark-mode .modal-header {
    background-color: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
}
body.dark-mode .modal-header .text-white {
    color: #8b5cf6 !important;
}

/* --- 2. Monthly Schedule (schedule_viewer.html / monthly_schedule.html) --- */
body.dark-mode .schedule-container, 
body.dark-mode .schedule-frame {
    background: #1e293b !important;
    border-color: #334155 !important;
}
body.dark-mode .schedule-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-bottom: 1px solid #334155 !important;
    color: #e2e8f0 !important;
}
body.dark-mode .calendar-grid {
    background-color: transparent !important;
}
body.dark-mode .calendar-day-header {
    background-color: #0f172a !important;
    color: #8b5cf6 !important;
    border: 1px solid #334155 !important;
}
body.dark-mode .calendar-day {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}
body.dark-mode .calendar-day:hover {
    background-color: #0f172a !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3) !important;
    border-color: #8b5cf6 !important;
}
body.dark-mode .day-number,
body.dark-mode .day-date {
    color: #e2e8f0 !important;
}

/* Override inline styles for Tasks inside the calendar */
body.dark-mode .task-item.preventive-task,
body.dark-mode .task-item.scheduled-task,
body.dark-mode .task-item {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    border-left: 4px solid #10b981 !important; /* Keep a nice green border for indication */
    box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
    margin-bottom: 4px !important;
}
body.dark-mode .task-item:hover {
    background-color: #1e293b !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4) !important;
}

/* --- 3. Technician Dashboard --- */
body.dark-mode .main-container,
body.dark-mode .form-section,
body.dark-mode .dashboard-widget {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}
body.dark-mode .task-card {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}
body.dark-mode .task-card:hover {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2) !important;
}

/* --- 4. Financial & Maintenance Reports --- */
body.dark-mode .report-card,
body.dark-mode .kpi-card,
body.dark-mode .summary-box,
body.dark-mode .balance-box {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .section-title,
body.dark-mode .header h1,
body.dark-mode .header h2,
body.dark-mode .header h3 {
    color: #e2e8f0 !important;
    border-bottom-color: #334155 !important;
}
body.dark-mode .header {
    background-color: transparent !important;
}
body.dark-mode .table-responsive {
    background-color: transparent !important;
}

/* Navigation Tabs */
body.dark-mode .nav-tabs .nav-link {
    color: #94a3b8 !important;
    border-color: transparent !important;
}
body.dark-mode .nav-tabs .nav-link.active {
    background-color: #1e293b !important;
    color: #8b5cf6 !important;
    border-color: #334155 #334155 #1e293b !important;
    border-bottom: 2px solid #8b5cf6 !important;
}
body.dark-mode .nav-tabs .nav-link:hover {
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

/* Form inputs global fix just in case */
body.dark-mode input.form-control,
body.dark-mode select.form-control,
body.dark-mode select.form-select,
body.dark-mode textarea.form-control {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}
body.dark-mode input.form-control::placeholder,
body.dark-mode textarea.form-control::placeholder {
    color: #64748b !important;
}

/* Quick general fix for anything missed */
body.dark-mode .bg-light,
body.dark-mode .bg-white {
    background-color: #1e293b !important;
}
body.dark-mode .text-dark,
body.dark-mode .text-black {
    color: #f8fafc !important;
}



/* =========================================
   NEON DARK MODE - TECHNICIAN DASHBOARD SPECIFICS
   ========================================= */

/* Add Technician & Stats Titles and Form Text */
body.dark-mode .form-section h5,
body.dark-mode .form-section h6,
body.dark-mode .stat-label {
    color: #e2e8f0 !important;
}
body.dark-mode .form-section h5[style*='color: var(--dark)'],
body.dark-mode .form-section h6[style*='color: var(--dark)'] {
    color: #e2e8f0 !important;
}

/* Form Section Input Labels and Helper texts */
body.dark-mode .form-row label,
body.dark-mode .form-section label,
body.dark-mode .form-section p,
body.dark-mode .form-section div {
    color: #cbd5e1 !important;
}

/* Fix Stats Summary Box (inline background) */
body.dark-mode div[style*='background: #f9fafb'] {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}
body.dark-mode div[style*='background: #f9fafb'] strong,
body.dark-mode div[style*='background: #f9fafb'] span {
    color: #e2e8f0 !important;
}

/* Stat Cards Override */
body.dark-mode .stat-card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5) !important;
}
body.dark-mode .stat-card:hover {
    border-color: #8b5cf6 !important;
    background-color: #0f172a !important;
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.2) !important;
}
body.dark-mode .stat-number {
    color: #f8fafc !important;
}

/* Override any inline var(--dark) globally (useful for headers) */
body.dark-mode [style*='color: var(--dark)'] {
    color: #e2e8f0 !important;
}

/* Input Fields specifically in form sections */
body.dark-mode .form-section input,
body.dark-mode .form-section select,
body.dark-mode .form-section textarea {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}
body.dark-mode .form-section input:focus,
body.dark-mode .form-section select:focus,
body.dark-mode .form-section textarea:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25) !important;
}

/* تحسين الطباعة للتقارير لضمان ظهور النصوص بوضوح باللون الأسود */
@media print {
    body, table, th, td, p, span, div, .text-gray-400, .text-gray-500, .text-gray-600, .text-muted {
        color: #000000 !important;
    }
    body, body.dark-mode, .dark-mode, .bg-dark, .bg-gray-900, .bg-slate-900, .card, .card-header, .table th, .table td { background-color: #ffffff !important; background: #ffffff !important; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}


/* شريط كود الآلة في نموذج إكمال الصيانة */
.complete-machinery-banner {
    background: linear-gradient(135deg, #1a2535, #253550);
    color: #fff;
    border-bottom: 3px solid #4a9eff;
    padding: .75rem 1.5rem;
}
.complete-machinery-banner .banner-icon {
    color: #4a9eff;
    opacity: .85;
    font-size: 2rem;
}
.complete-machinery-banner .banner-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .7;
}
.complete-machinery-banner .banner-code {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .03em;
}
.complete-machinery-banner .banner-type {
    font-size: .85rem;
    opacity: .8;
    margin-top: .15rem;
}

/* قائمة اختيار الفنيين المتعددين */
.tech-checkbox-list {
    max-height: 170px;
    overflow-y: auto;
    background: #fff;
}
.tech-checkbox-list .form-check {
    padding: .3rem .5rem;
    border-radius: 4px;
    transition: background .15s;
}
.tech-checkbox-list .form-check:hover {
    background: #f0f4ff;
}
.tech-checkbox-list .form-check-input:checked + .form-check-label {
    color: #1a6fc4;
    font-weight: 600;
}

/* parts table scrollable container */
.parts-table-scroll {
    max-height: 150px;
    overflow-y: auto;
}
