/*
    ____        _   _   _             _             _   _             
     | __ )  __ _| |_| |_| | ___   __ _(_)_ __   __ _| |_(_) ___  _ __  
     |  _ \ / _` | __| __| |/ _ \ / _` | | '_ \ / _` | __| |/ _ \| '_ \ 
     | |_) | (_| | |_| |_| | (_) | (_| | | | | | (_| | |_| | (_) | | | |
     |____/ \__,_|\__|\__|_|\___/ \__, |_|_| |_|\__,_|\__|_|\___/|_| |_|
                                |___/                                 
                                                                        
    Made with Software Team "Adli Dasouqi" 0 (https://xcode-dev.netlify.app/)                                                                        
*/

:root {
    /* ===== New theme (matches IT report design system) ===== */
    --navy:#093c71;
    --navy2:#083b71;
    --blue:#1f5087;
    --teal:#1dccc9;
    --teal2:#1ececa;
    --green:#a1d55d;
    --bg:#f0f4f8;
    --ink:#0c2340;
    --muted:#5b7291;
    --card:#ffffff;
    --radius:18px;
    --shadow-lg:0 20px 45px -20px rgba(9,60,113,.28);
    --shadow-sm:0 8px 20px -10px rgba(9,60,113,.22);

    /* ===== Legacy variable names remapped so the rest of this file re-skins automatically ===== */
    --primary-color: var(--navy);
    --primary-dark: var(--navy2);
    --secondary-color: var(--blue);
    --accent-color: var(--teal);
    --light-color: var(--bg);
    --text-color: var(--ink);
    --border-color: rgba(9,60,113,.12);
    --shadow: var(--shadow-sm);
    --shadow-hover: var(--shadow-lg);
}

/* ===== Animated background layers ===== */
.bg-grid{
    position:fixed;
    inset:0;
    background-image:
        linear-gradient(rgba(9,60,113,.035) 1px,transparent 1px),
        linear-gradient(90deg,rgba(9,60,113,.035) 1px,transparent 1px);
    background-size:42px 42px;
    pointer-events:none;
    z-index:0;
    mask-image:radial-gradient(ellipse 80% 60% at 50% 0%,#000 40%,transparent 100%);
}
.global-network{
    position:fixed;
    inset:0;
    width:100%;
    height:100%;
    z-index:0;
    pointer-events:none;
    opacity:.6;
}
.professional-header,
.professional-nav,
.main-content,
.professional-footer{
    position:relative;
    z-index:1;
}

* {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    cursor: default;
}

/* Professional Header */
.professional-header {
    background: white;
    padding: 1.1rem 0;
    border-bottom: 2px solid var(--navy);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: default;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.logo-section:hover {
    opacity: 0.9;
}

.logo-wrap{
    background:#fff;
    border-radius:12px;
    padding:4px 6px;
}

.logo {
    height: 52px;
    width: auto;
}

.header-titles h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0;
    line-height: 1.3;
    cursor: default;
}

.header-titles .subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
    font-weight: 500;
    cursor: default;
}

.info-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

/* ===== Algorithmic Live Clock ===== */
.algo-clock{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:.35rem;
    font-family:'Consolas','JetBrains Mono','Courier New',monospace;
}
.algo-clock-date{
    font-size:.72rem;
    color:var(--muted);
    font-weight:600;
    letter-spacing:.2px;
    direction:ltr;
    text-align:right;
    unicode-bidi:isolate;
}
.algo-clock-time{
    display:flex;
    align-items:center;
    gap:2px;
    background:#fff;
    border:1.5px solid var(--navy);
    padding:.4rem .65rem;
    border-radius:9px;
    box-shadow:0 3px 8px rgba(9,60,113,.12);
    direction:ltr;
}
.algo-clock-time .ac-bracket{
    color:var(--blue);
    font-weight:800;
    font-size:1rem;
    opacity:.85;
}
.ac-unit{
    display:flex;
    flex-direction:column;
    align-items:center;
    position:relative;
}
.ac-digits{
    display:flex;
    gap:1px;
    background:rgba(9,60,113,.06);
    border-radius:5px;
    padding:2px 5px;
    min-width:34px;
    justify-content:center;
}
.ac-digit{
    font-size:1.05rem;
    font-weight:800;
    color:var(--navy);
    display:inline-block;
    transition:transform .18s ease, opacity .18s ease;
}
.ac-digit.flip{
    animation:acFlip .35s ease;
}
@keyframes acFlip{
    0%{transform:translateY(-40%);opacity:0;}
    100%{transform:translateY(0);opacity:1;}
}
.ac-label{
    font-size:.55rem;
    color:var(--muted);
    font-weight:700;
    letter-spacing:.5px;
    margin-top:2px;
    text-transform:uppercase;
}
.ac-colon{
    color:var(--blue);
    font-weight:800;
    font-size:1.05rem;
    align-self:flex-start;
    margin-top:1px;
    animation:acBlink 1s step-start infinite;
}
.ac-seconds .ac-digits{
    background:rgba(161,213,93,.28);
    box-shadow:0 0 0 1px rgba(161,213,93,.55);
}
.ac-ampm{
    color:var(--blue);
    font-weight:800;
    font-size:.78rem;
    margin-inline-start:5px;
    align-self:center;
}
@keyframes acBlink{
    50%{opacity:.15;}
}

.version-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: default;
}

/* Navigation */
.professional-nav {
    background: var(--navy);
    padding: 0.7rem 0;
    display: none;
}

.professional-nav.visible {
    display: block;
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.nav-item {
    position: relative;
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 14px;
    transition: color .25s;
    border-right: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: none;
    border: none;
    overflow: hidden;
    isolation: isolate;
}

.nav-item:first-child {
    border-right: none;
}

.nav-item i {
    font-size: .85rem;
    opacity: .85;
    transition: color .25s, transform .3s;
}

.nav-item:hover i,
.nav-item.active i {
    color: var(--green);
}

.nav-item:hover i {
    transform: scale(1.15) rotate(-4deg);
}

/* light-sweep pass on hover */
.nav-sweep{
    position:absolute;
    inset:0;
    background:linear-gradient(100deg, transparent 20%, rgba(161,213,93,.32) 48%, transparent 76%);
    transform:translateX(-120%);
    transition:transform .55s cubic-bezier(.22,.9,.3,1);
    pointer-events:none;
    z-index:0;
}
.nav-item:hover .nav-sweep{transform:translateX(120%);}

/* code-bracket reveal around the label */
.nav-label{
    position:relative;
    z-index:1;
    padding:0 3px;
}

/* growing underline */
.nav-underline{
    position:absolute;
    bottom:0; left:50%;
    width:0;
    height:2px;
    background:var(--green);
    box-shadow:0 0 8px rgba(161,213,93,.7);
    transform:translateX(-50%);
    transition:width .3s ease;
    z-index:1;
}
.nav-item:hover .nav-underline{width:62%;}
.nav-item.active .nav-underline{width:62%;background:#fff;box-shadow:none;}

.nav-item:hover {
    background: var(--navy2);
    color: white;
}

.nav-item.active {
    background: var(--navy2);
    position: relative;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -0.8rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--navy2);
}

.nav-item-logout {
    margin-inline-start: .5rem;
    border-right: 1px solid rgba(255,255,255,0.12);
}

.nav-item-logout i,
.nav-item-logout .nav-label {
    color: #ffb4b4;
}

.nav-item-logout:hover {
    background: #7a2530;
}

.nav-item-logout:hover i,
.nav-item-logout:hover .nav-label {
    color: #ffffff;
}

/* ===== Mobile hamburger toggle for nav ===== */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    padding: 0.55rem 0.25rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}

.nav-hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 22px;
    height: 16px;
}

.nav-hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}

.nav-hamburger.open .nav-hamburger-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav-hamburger.open .nav-hamburger-icon span:nth-child(2) {
    opacity: 0;
}
.nav-hamburger.open .nav-hamburger-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

.content-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.2rem 1.5rem;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
}

/* Cards Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.item-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem;
    transition: all 0.3s ease;
    background: white;
}

.item-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.item-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.meta-info {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge {
    background: var(--accent-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #28a745;
}

.badge-danger {
    background: #dc3545;
}

/* Footer داخل بطاقة الفرع: الحالة + زر عرض الخدمات جنب بعض */
.item-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.item-card-footer .badge {
    flex-shrink: 0;
}

.item-card-footer .btn {
    white-space: nowrap;
}

/* Table */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 650px;
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    font-weight: 600;
    text-align: right;
    font-size: 0.9rem;
    cursor: default;
}

.table tbody td {
    padding: 1rem;
    text-align: right;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: rgba(26, 82, 118, 0.03);
    cursor: default;
}

.action-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
}

.action-link:hover {
    color: var(--primary-dark);
    background: rgba(26, 82, 118, 0.05);
    border-color: rgba(26, 82, 118, 0.1);
    text-decoration: none;
}

.action-link i {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Login Button */
.login-btn {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal */
.modal-content {
    border-radius: 8px;
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    border-right: 4px solid var(--primary-color);
}

.toast-notification.success {
    border-right-color: #28a745;
}

.toast-notification.error {
    border-right-color: #dc3545;
}

.toast-notification.warning {
    border-right-color: #ffc107;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-notification.success .toast-icon {
    color: #28a745;
}

.toast-notification.error .toast-icon {
    color: #dc3545;
}

.toast-notification.warning .toast-icon {
    color: #ffc107;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.9rem;
    color: #6c757d;
}

.toast-close {
    color: #6c757d;
    cursor: pointer;
    transition: color 0.3s ease;
}

.toast-close:hover {
    color: var(--primary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-notification.hiding {
    animation: slideOut 0.3s ease forwards;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: 3rem 2rem;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.welcome-text {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-to-site-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.stats-single {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.stat-card-single {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 12px;
    padding: 2rem 3rem;
    text-align: center;
    box-shadow: var(--shadow-hover);
    max-width: 400px;
    width: 100%;
}

.stat-card-single i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-card-single h3 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card-single p {
    font-size: 1.3rem;
    margin: 0;
    opacity: 0.9;
}

/* Profile Section */
.profile-section {
    padding: 2rem;
}

.profile-field {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field-label {
    width: 150px;
    font-weight: 600;
    color: var(--primary-color);
}

.profile-field-value {
    flex: 1;
    color: var(--text-color);
}

.profile-field-value.empty {
    color: #6c757d;
    font-style: italic;
}

.profile-logout-wrap {
    padding: 0 2rem 2rem;
    display: flex;
    justify-content: flex-end;
}

/* Footer */
.professional-footer {
    background: white;
    border-top: 2px solid var(--primary-color);
    padding: 2rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.footer-section h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
    cursor: default;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.footer-link:hover {
    color: var(--primary-color);
}

.footer-link i {
    font-size: 0.7rem;
    opacity: 0.7;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #6c757d;
    cursor: default;
}

.contact-item i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.location-link, .email-link, .whatsapp-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
}

.location-link:hover, .email-link:hover, .whatsapp-link:hover {
    color: var(--primary-color);
}

.copyright {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.8rem;
    cursor: default;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f8f9fa;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.social-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.social-icon.linkedin:hover { background: #0077b5; color: white !important; }
.social-icon.instagram:hover { background: #e4405f; color: white !important; }
.social-icon.facebook:hover { background: #1877f2; color: white !important; }
.social-icon.twitter:hover { background: #000000; color: white !important; }
.social-icon.youtube:hover { background: #ff0000; color: white !important; }
.social-icon.whatsapp:hover { background: #25D366; color: white !important; }

.whatsapp-link {
    unicode-bidi: embed;
    direction: ltr;
}

/* X (Twitter) custom icon */
.x-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    position: relative;
}

.x-icon::before, .x-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    top: 50%;
    left: 0;
}

.x-icon::before {
    transform: translateY(-50%) rotate(45deg);
}

.x-icon::after {
    transform: translateY(-50%) rotate(-45deg);
}

/* Service Link Style */
.service-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    gap: 1rem;
}

.service-link:hover {
    background: rgba(26, 82, 118, 0.03);
    border-color: var(--primary-color);
    transform: translateX(-5px);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
}

.link-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.link-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.link-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.link-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.link-arrow {
    color: var(--primary-color);
    font-size: 1.1rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.service-link:hover .link-arrow {
    opacity: 1;
    transform: translateX(-3px);
}

/* Responsive */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .info-section {
        align-items: center;
    }
    
    .nav-hamburger {
        display: flex;
    }

    .nav-container {
        flex-wrap: wrap;
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height .3s ease, opacity .25s ease;
    }

    .nav-container.open {
        max-height: 500px;
        opacity: 1;
        padding-bottom: 0.5rem;
    }
    
    .nav-item {
        flex: none;
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-item.active::after {
        display: none;
    }

    .nav-item-logout {
        margin-inline-start: 0;
        border-right: none;
        border-top: 1px solid rgba(255,255,255,0.15);
        margin-top: 0.25rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-link {
        padding: 0.8rem 1rem;
    }
    
    .link-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .link-title {
        font-size: 1rem;
    }
    
    .link-description {
        font-size: 0.85rem;
    }

    .stat-card-single {
        padding: 1.5rem 2rem;
    }

    .stat-card-single h3 {
        font-size: 2.5rem;
    }

    .stat-card-single p {
        font-size: 1.1rem;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .welcome-text {
        font-size: 1rem;
    }

    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .profile-field-label {
        width: auto;
    }
}
/* Service Tree with Dropdown Styles */
.services-container {
    direction: rtl;
}

.service-group {
    margin-bottom: 1rem;
}

.parent-header {
    transition: all 0.3s ease;
    cursor: pointer;
}

.parent-header:hover {
    background: #e3f2fd !important;
    transform: translateX(-3px);
}

.child-service {
    transition: all 0.3s ease;
}

.child-service:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.badge-lg {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* Ticket Details */
.ticket-details .display-4 {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0;
}

/* Filter Buttons */
.btn-group .btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Table Enhancements */
.table td, .table th {
    vertical-align: middle;
}

/* Dropdown Content Animation */
.dropdown-content {
    transition: all 0.3s ease;
}

/* Quick Book Modal */
.list-group-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(-5px);
}

.list-group-item:hover i {
    color: white !important;
}

/* Responsive */
@media (max-width: 768px) {
    .service-group {
        margin-right: 0 !important;
    }
    
    .parent-header, .child-service {
        padding: 8px !important;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        flex: 1 1 auto;
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .ticket-details .display-4 {
        font-size: 2.5rem;
    }
}

/* Dropdown Button */
.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Bookable Services Button */
.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

/* Status Badges */
.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}
/* Pagination Styles */
.pagination {
    gap: 5px;
}

.page-link {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.9rem;
    border-radius: 6px !important;
    color: var(--primary-color);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.page-item.disabled .page-link {
    color: #6c757d;
    background: #f8f9fa;
    border-color: var(--border-color);
    cursor: not-allowed;
    pointer-events: none;
}

.page-item:first-child .page-link,
.page-item:last-child .page-link {
    padding: 0.5rem 1rem;
}

/* Card Footer */
.card-footer {
    background: var(--light-color);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.text-muted {
    color: #6c757d;
    font-size: 0.9rem;
}

.text-muted strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .card-footer .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }
}
/* ==================== تحسينات واجهة المستخدم ==================== */

/* بطاقة إحصائيات محسنة */
.stats-banner {
    background: #f0f4f8;
    color: var(--primary-color);
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    margin: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #dde5ee;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats-icon {
    width: 48px;
    height: 48px;
    background: rgba(26, 82, 118, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stats-info h4 {
    font-size: 0.9rem;
    opacity: 0.7;
    margin: 0;
    color: var(--primary-color);
}

.stats-info p {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: #1a1a2e;
}

/* تحسين عرض الحالات */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge i {
    font-size: 0.7rem;
}

.status-badge.scheduled {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-badge.confirmed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.checked-in {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.status-badge.cancelled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-badge.completed {
    background: #d1e7dd;
    color: #0a3622;
    border: 1px solid #a3cfbb;
}

/* أيقونات الإجراءات */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.action-btn.cancel:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.action-btn.view:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* بطاقات التذاكر */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.ticket-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.ticket-card.warning::before {
    background: #ffc107;
}

.ticket-card.success::before {
    background: #28a745;
}

.ticket-card.danger::before {
    background: #dc3545;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ticket-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.ticket-type {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--light-color);
    color: var(--text-color);
}

.ticket-info {
    margin-bottom: 0.8rem;
}

.ticket-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.ticket-info-item i {
    width: 16px;
    color: var(--primary-color);
}

.ticket-position {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.position-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.waiting-count {
    color: #6c757d;
    font-size: 0.8rem;
}

.waiting-count strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* فلتر التذاكر */
.tickets-filter {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.filter-btn:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn i {
    margin-left: 0.4rem;
}

/* رسالة فارغة محسنة */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--primary-color);
}

.empty-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-text {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* تحسين الجدول */
.table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* تحسين الـ Pagination */
.pagination-info {
    background: var(--light-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* استجابة للموبايل */
@media (max-width: 768px) {
    .stats-banner {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        margin: 1rem 0.75rem;
        padding: 1rem;
    }
    
    .stats-item {
        justify-content: space-between;
        width: 100%;
        background: #fff;
        border: 1px solid #dde5ee;
        border-radius: 10px;
        padding: 0.7rem 0.9rem;
        gap: 0.75rem;
    }

    .stats-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .stats-info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 1;
        gap: 0.5rem;
    }

    .stats-info h4 {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .stats-info p {
        font-size: 1.3rem;
    }
    
    .tickets-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
    }
    
    .action-buttons {
        justify-content: center;
    }
}

/* ==================== إصلاح مشكلة اختفاء الفروع على الجوال ==================== */
@media (max-width: 768px) {
    /* تأكيد ظهور البطاقات */
    .items-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 15px !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* تأكيد ظهور كل بطاقة */
    .item-card {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 15px !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        background: white !important;
    }
    
    /* تأكيد ظهور النصوص */
    .item-card h3,
    .item-card .meta-info {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .item-card .badge,
    .item-card .btn {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .item-card-footer {
        display: flex !important;
    }
    
    /* تأكيد ظهور المحتوى الرئيسي */
    .main-content,
    .content-card,
    .dynamicContent,
    #dynamicContent {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: 100% !important;
    }
    
    /* إلغاء أي display:none ممكن يكون مخفي */
    .items-grid,
    .item-card,
    .content-card {
        display: block !important;
    }
}

/* للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .stats-banner {
        margin: 0.75rem 0.5rem;
        padding: 0.75rem;
    }

    .stats-item {
        padding: 0.6rem 0.75rem;
    }

    .stats-icon {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
    }

    .stats-info h4 {
        font-size: 0.78rem;
    }

    .stats-info p {
        font-size: 1.15rem;
    }

    .items-grid {
        padding: 10px !important;
        gap: 10px !important;
    }
    
    .item-card {
        padding: 12px !important;
    }

    .item-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .item-card-footer .badge {
        align-self: flex-start;
    }

    .item-card-footer .btn {
        width: 100%;
        text-align: center;
    }
}
/* ===== Unified button theme (matches IT report style) ===== */
.btn-primary,
.btn.btn-primary {
    background: linear-gradient(135deg, var(--navy), var(--blue)) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 10px 22px -10px rgba(9,60,113,.5);
    transition: .25s;
}
.btn-primary:hover,
.btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px -10px rgba(9,60,113,.55);
    color: #fff !important;
}

.btn-success,
.btn.btn-success {
    background: linear-gradient(135deg, var(--green), #8bc34a) !important;
    border: none !important;
    color: var(--ink) !important;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 10px 22px -10px rgba(161,213,93,.5);
    transition: .25s;
}
.btn-success:hover,
.btn.btn-success:hover {
    transform: translateY(-2px);
    color: var(--ink) !important;
}

.btn-secondary,
.btn.btn-secondary {
    background: #fff !important;
    color: var(--navy) !important;
    border: 1.5px solid rgba(9,60,113,.15) !important;
    font-weight: 700;
    border-radius: 10px;
    transition: .25s;
}
.btn-secondary:hover,
.btn.btn-secondary:hover {
    border-color: var(--teal) !important;
    color: var(--teal) !important;
}

/* Custom scrollbar */
::-webkit-scrollbar{width:9px;height:9px;}
::-webkit-scrollbar-track{background:var(--bg);}
::-webkit-scrollbar-thumb{background:var(--blue);border-radius:10px;}

/* حقل رقم الهاتف - يبدأ من اليمين */
.phone-input {
    direction: rtl;
    text-align: right;
}

.phone-input::placeholder {
    direction: rtl;
    text-align: right;
}

/* رسالة خطأ inline تحت حقول الإدخال */
.field-error {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.field-error i {
    color: #dc3545;
    font-size: 0.85rem;
}

.field-error.success {
    color: #28a745;
}
.field-error.success i {
    color: #28a745;
}

.field-error.info {
    color: var(--primary-color);
}
.field-error.info i {
    color: var(--primary-color);
}

.field-error.warning {
    color: #b8860b;
}
.field-error.warning i {
    color: #b8860b;
}

.inline-toast-message {
    background: rgba(220, 53, 69, 0.08);
    border-radius: 6px;
    padding: 0.65rem 0.9rem;
    margin-bottom: 1rem;
}

.inline-toast-message.success {
    background: rgba(40, 167, 69, 0.08);
}

.inline-toast-message.info {
    background: rgba(9, 60, 113, 0.08);
}

.inline-toast-message.warning {
    background: rgba(255, 193, 7, 0.14);
}

.form-control.is-invalid-field {
    border-color: #dc3545 !important;
}

.form-control.is-invalid-field:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15) !important;
}

/* مودال التأكيد الاحترافي (بديل confirm() الافتراضي بالمتصفح) */
.confirm-modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.confirm-modal-content .modal-body {
    padding: 2.2rem 2rem 1rem;
}

.confirm-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    font-size: 1.9rem;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.confirm-icon.warning {
    background: rgba(255, 193, 7, 0.15);
    color: #b8860b;
}

.confirm-icon.primary {
    background: rgba(9, 60, 113, 0.1);
    color: var(--primary-color);
}

.confirm-modal-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: #1a1a1a;
    margin-bottom: 0.6rem;
}

.confirm-modal-message {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.confirm-modal-footer {
    border-top: none;
    padding: 1rem 2rem 2rem;
    display: flex;
    gap: 0.75rem;
}

.confirm-modal-footer .btn {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-weight: 600;
}