@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* GLOBAL CSS VARIABLES */
:root {
    --primary-color: #0B192C;     /* Deep Navy Blue */
    --primary-light: #1E3E62;     /* Medium Navy */
    --accent-color: #F1C40F;      /* Golden Yellow */
    --accent-hover: #D4AC0D;      /* Darker Gold */
    --bg-color: #F8FAFC;          /* Soft Gray-White */
    --text-main: #0F172A;         /* Slate-900 */
    --text-secondary: #64748B;    /* Slate-500 */
    --white: #FFFFFF;
    --border-color: #E2E8F0;      /* Slate-200 */
    --green-success: #10B981;     /* Emerald-500 */
    --red-danger: #EF4444;        /* Rose-500 */
    --orange-warning: #F59E0B;    /* Amber-500 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --border-radius: 12px;
}

/* RESET & CORE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    height: 100vh;
    overflow: hidden; /* Prevent body scrolling */
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input, select, textarea {
    font-family: 'Cairo', sans-serif;
    outline: none;
}

/* APP LAYOUT - FIXED HEIGHT NO SCROLL */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR (RIGHT SIDE IN RTL) */
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
    border: 2px solid var(--white);
}

.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    line-height: 1.4;
}

.sidebar-menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px 10px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 5px;
    border-radius: var(--border-radius);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.menu-item.active {
    background-color: var(--primary-light);
    color: var(--accent-color);
    font-weight: 600;
    border-right: 4px solid var(--accent-color);
}

.menu-item i {
    margin-left: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.2);
}

.user-profile-summary {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 6px;
}
.user-profile-summary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 10px;
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: 11px;
    color: var(--accent-color);
    font-weight: 500;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

/* MAIN CONTENT AREA */
.main-content {
    flex-grow: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* TOP HEADER */
.header {
    height: 70px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.header-right {
    display: flex;
    align-items: center;
}

.header-wisdom {
    background-color: #FFFDF0;
    border-right: 4px solid var(--accent-color);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #856404;
    max-width: 500px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* NOTIFICATION BELL */
.notification-container {
    position: relative;
    cursor: pointer;
}

.notification-bell {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    border: 1px solid var(--border-color);
}

.notification-bell:hover {
    color: var(--primary-color);
    background-color: var(--border-color);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--red-danger);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--white);
}

/* NOTIFICATION DROPDOWN */
.notification-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    width: 320px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.notification-dropdown.open {
    display: block;
}

.notif-header {
    padding: 12px 15px;
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

.notif-list {
    max-height: 250px;
    overflow-y: auto;
}

.notif-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.notif-item:hover {
    background-color: var(--bg-color);
}

.notif-item.unread {
    background-color: #F0F9FF;
    border-right: 3px solid #0284C7;
}

.notif-item-title {
    font-weight: 600;
    margin-bottom: 3px;
}

.notif-item-time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.logout-btn {
    padding: 8px 15px;
    border-radius: var(--border-radius);
    background-color: #FEF2F2;
    color: var(--red-danger);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border: 1px solid #FEE2E2;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    background-color: var(--red-danger);
    color: var(--white);
}

/* CONTENT VIEWPORT (SCROLLABLE HERE ONLY) */
.content-view {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
}

.content-view::-webkit-scrollbar {
    width: 6px;
}
.content-view::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 3px;
}

/* CARDS DESIGN */
.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* DASHBOARD STATS WIDGETS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-normal);
    overflow: hidden;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 4px;
    background-color: var(--border-color);
}

.stat-card.blue::after { background-color: var(--primary-light); }
.stat-card.gold::after { background-color: var(--accent-color); }
.stat-card.green::after { background-color: var(--green-success); }
.stat-card.red::after { background-color: var(--red-danger); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card.blue .stat-icon { background-color: #EFF6FF; color: #3B82F6; }
.stat-card.gold .stat-icon { background-color: #FFFBEB; color: var(--orange-warning); }
.stat-card.green .stat-icon { background-color: #ECFDF5; color: var(--green-success); }
.stat-card.red .stat-icon { background-color: #FFF1F2; color: var(--red-danger); }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 5px;
}

/* BUTTONS */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-light);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-color);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: 1px solid var(--accent-hover);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
}

.btn-success {
    background-color: var(--green-success);
    color: var(--white);
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background-color: var(--red-danger);
    color: var(--white);
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: var(--white);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.btn i {
    font-size: 14px;
}

/* FORM ELEMENTS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #FAFAFA;
    color: var(--text-main);
    font-size: 13px;
    transition: var(--transition-fast);
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary-light);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(30, 62, 98, 0.1);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* CUSTOM TABLES */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: right;
}

.custom-table th {
    background-color: #F1F5F9;
    color: var(--text-main);
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.custom-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
    white-space: nowrap;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:nth-child(even) {
    background-color: #F8FAFC;
}

.custom-table tr:hover {
    background-color: #F1F5F9;
}

/* BADGES & STATUS INDICATORS */
.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-primary { background-color: #EFF6FF; color: #1D4ED8; }
.badge-success { background-color: #ECFDF5; color: var(--green-success); }
.badge-warning { background-color: #FFFBEB; color: var(--orange-warning); }
.badge-danger { background-color: #FFF1F2; color: var(--red-danger); }
.badge-secondary { background-color: #F1F5F9; color: var(--text-secondary); }

/* PROGRESS BARS */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--green-success);
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* TIMELINE (STAGES TRACKING) */
.timeline-stages {
    position: relative;
    padding: 10px 0;
}

.timeline-stages::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 15px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-stage-item {
    position: relative;
    padding-right: 45px;
    margin-bottom: 25px;
}

.timeline-stage-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    right: 6px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--white);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.timeline-stage-item.completed .timeline-dot {
    border-color: var(--green-success);
    background-color: var(--green-success);
}

.timeline-stage-item.in_progress .timeline-dot {
    border-color: var(--orange-warning);
    background-color: var(--white);
}

.timeline-stage-item.delayed .timeline-dot {
    border-color: var(--red-danger);
    background-color: var(--red-danger);
}

.timeline-content {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--shadow-sm);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.timeline-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
}

.timeline-dates {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timeline-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-images {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.timeline-img-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--text-secondary);
}

.timeline-img-box img {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* MODAL WINDOWS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 25, 44, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.modal-close {
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
}

.modal-close:hover {
    color: var(--red-danger);
}

/* LOGIN & REGISTER SCREENS */
.auth-wrapper {
    width: 100vw;
    height: 100vh;
    background-color: var(--primary-color);
    background-image: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background-color: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 30px;
    text-align: center;
}

.auth-header {
    margin-bottom: 25px;
}

.auth-logo {
    width: 70px;
    height: 70px;
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 15px;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.4);
}

.auth-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
}

.auth-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.auth-link {
    font-size: 12px;
    color: var(--primary-light);
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    margin-top: 10px;
}

.auth-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* CALCULATOR STYLING */
.calc-results {
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.calc-total-cost {
    background-color: #FFFDF0;
    border: 1px dashed var(--accent-color);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    margin-top: 15px;
}

/* PRINT MEDIA QUERIES FOR REPORTS */
@media print {
    body {
        background-color: var(--white);
        color: #000;
        direction: rtl;
    }
    .sidebar, .header, .btn, .modal-overlay, .notification-bell {
        display: none !important;
    }
    .main-content {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
    .content-view {
        padding: 0 !important;
        overflow: visible !important;
    }
    .card {
        box-shadow: none !important;
        border: none !important;
        page-break-inside: avoid;
    }
}

/* --- NEW CUSTOM STYLING RULES --- */

.department-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.department-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}
.department-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}
.department-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.department-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #EFF6FF;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-fast);
}
.department-card:hover .department-card-icon {
    background: var(--accent-color);
    color: var(--primary-color);
}
.department-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
}
.department-card-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0.9;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.department-card:hover .department-card-links,
.department-card.open .department-card-links {
    max-height: 200px;
}
.department-link {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}
.department-link:hover {
    background: #F1F5F9;
    color: var(--primary-light);
    padding-right: 12px;
}

/* Org Chart Styling */
.org-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    padding: 20px 0;
}
.org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.org-node {
    background: var(--white);
    border: 2px solid var(--primary-light);
    border-radius: 8px;
    padding: 12px 18px;
    text-align: center;
    min-width: 170px;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: all var(--transition-fast);
}
.org-node:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
}
.org-node-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.org-node-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 4px 0;
}
.org-node-code {
    font-size: 10px;
    color: var(--accent-hover);
    background: #FFFDF0;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    border: 1px solid rgba(241, 196, 15, 0.3);
}
.org-children {
    display: flex;
    justify-content: center;
    gap: 20px;
    position: relative;
}

/* Printable Voucher & Invoice Layouts */
.print-layout {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    border: 1px solid var(--border-color);
    background: var(--white);
    font-family: 'Cairo', sans-serif;
    color: #000;
    box-shadow: var(--shadow-sm);
    direction: rtl;
}
.print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px double var(--primary-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}
.print-logo-box {
    display: flex;
    align-items: center;
    gap: 15px;
}
.print-logo-box img {
    max-height: 80px;
    object-fit: contain;
}
.print-title {
    text-align: center;
}
.print-title h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
}
.print-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    font-size: 14px;
}
.print-amount-box {
    border: 2px solid var(--primary-color);
    padding: 10px 25px;
    font-size: 18px;
    font-weight: 800;
    background: #F8FAFC;
    display: inline-block;
    margin-bottom: 20px;
    border-radius: 4px;
}
.print-body-text {
    font-size: 15px;
    line-height: 2;
    margin-bottom: 40px;
}
.print-footer-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.signature-line {
    text-align: center;
    width: 200px;
}
.signature-line div {
    margin-top: 50px;
    border-top: 1px dashed #000;
    padding-top: 5px;
    font-size: 13px;
    font-weight: 700;
}

/* General table wrap adjustment */
.no-wrap-table td, .no-wrap-table th {
    white-space: nowrap;
}

/* Merged Category Cards (Hover Reveal) */
.merged-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.merged-category-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.merged-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent-color));
    opacity: 0.8;
}

.merged-category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.merged-category-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.merged-category-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #EFF6FF;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.merged-category-card:hover .merged-category-icon {
    background: var(--primary-light);
    color: var(--white);
    transform: scale(1.05);
}

.merged-category-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.merged-category-info p {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.merged-category-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.merged-category-card:hover .merged-category-links {
    max-height: 300px;
    opacity: 1;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #F1F5F9;
}

.merged-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #F8FAFC;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.merged-link-item i {
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.merged-link-item:hover {
    background: #EFF6FF;
    color: var(--primary-light);
    padding-right: 18px;
}

.merged-link-item:hover i {
    color: var(--primary-light);
    transform: translateX(-4px);
}

/* Compact Quick Action Cards */
.quick-actions-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    padding: 12px 8px !important;
    font-size: 11px !important;
    height: 80px !important;
    background-color: var(--white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    transition: all var(--transition-fast) !important;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.quick-action-btn i {
    font-size: 18px !important;
    margin: 0 !important;
}

.quick-action-btn span {
    font-weight: 700;
    color: var(--text-main);
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light) !important;
    background-color: #F8FAFC !important;
}

/* Dashboard Charts */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    min-height: 250px;
    margin-top: 15px;
}

.chart-title {
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
}

.chart-container {
    position: relative;
    height: 200px;
}

/* ============================================================
   ENGINEERING DASHBOARD NO-SCROLL LAYOUT (SCREENSHOT THEME)
   ============================================================ */
.dashboard-engineering-frame {
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 18px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
}

.dash-tab-btn {
    background: transparent;
    color: #64748b;
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
}

.dash-tab-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.dash-tab-btn.active {
    background: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.dash-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.dash-action-card:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dash-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.dash-action-icon.blue {
    background: #eff6ff;
    color: #0284c7;
    border: 1px solid #bfdbfe;
}

.dash-action-icon.dark {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.dash-action-icon.red {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.dash-action-icon.gold {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.dash-action-label {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    text-align: center;
    line-height: 1.3;
}

.daily-closing-card {
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 8px 12px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.daily-closing-card.highlight {
    background: #f0fdf4;
    border-color: #86efac;
}

.daily-closing-card:hover {
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
    border-color: #0284c7;
}

.daily-closing-header {
    text-align: center;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.daily-closing-date {
    font-size: 11px;
    font-weight: 800;
    color: #1e3a8a;
    font-family: monospace;
}

.daily-closing-day {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
}

.daily-closing-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-bottom: 3px;
    color: #334155;
}

.daily-closing-val {
    font-weight: 700;
    font-family: monospace;
}

