:root {
    /* Primary Color Palette (Derived from Logo) */
    --color-primary-green: #3B2A15;
    --color-primary-gold: #C4A882;
    --color-text-dark: #1E1208;
    --color-text-light: #ecf0f1;
    --color-bg-light: #FAF6F0;
    --color-white: #ffffff;

    /* Functional Colors */
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --blur-amount: 10px;

    /* Font Settings */
    --font-family-base: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --transition-speed: 0.3s;

    /* Premium Strategic Plan Theme - Updated to match Logo (Green & Gold) */
    --color-premium-olive: #3B2A15;
    /* Deep Brown */
    --color-premium-gold: #C4A882;
    /* Logo Gold */
    --color-premium-gold-light: #FAF6F0;
    /* Very Light Gold for backgrounds */
    --color-premium-maroon: #6B5540;
    /* Medium Brown */
    --color-sidebar-orange: #FF9D00;
    /* Requested Orange */
    --color-reward-cyan: #01B8EC;
    --color-reward-orange: #FF9D00;
    --color-reward-light-brown: #6B5540;
    --color-reward-dark-brown: #3B2A15;
}

/* Premium Component Styles */
.modal-premium-header h3 {
    color: white !important;
    flex: 1;
    margin: 0;
}

.modal-premium-header {
    background: #3B2A15;
    color: var(--color-white);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 3px solid var(--color-premium-gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    padding: 20px 30px;
    /* Increased size as requested */
}

.fieldset-premium {
    border: 2px solid var(--color-premium-gold);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    background: rgba(26, 77, 46, 0.02);
    /* Very light green tint */
}

.legend-premium {
    font-weight: bold;
    background: var(--color-premium-olive);
    color: var(--color-premium-gold);
    font-size: 1.05rem;
    padding: 8px 25px;
    border-radius: 8px;
    border: 1px solid var(--color-premium-gold);
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
    min-width: 280px;
    white-space: nowrap;
    justify-content: center;
}

.checkbox-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.checkbox-item-premium {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-item-premium:hover {
    background: rgba(212, 175, 55, 0.1);
}

.checkbox-item-premium input[type="radio"],
.checkbox-item-premium input[type="checkbox"] {
    accent-color: var(--color-premium-olive);
    width: 18px;
    height: 18px;
}

.premium-btn-save {
    background: #3B2A15;
    color: #ffffff;
    border: 2px solid var(--color-premium-gold);
    min-width: 200px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(128, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.premium-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(128, 0, 0, 0.4);
    color: white;
}

.premium-btn-action {
    background: var(--color-premium-maroon);
    color: var(--color-premium-gold);
    border: 1px solid var(--color-premium-gold);
    padding: 6px 15px;
    font-size: 0.9rem;
}

.premium-btn-smart {
    background: var(--color-premium-gold);
    color: var(--color-premium-olive);
    font-weight: bold;
    border: none;
    border-radius: 20px;
    padding: 6px 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.checkbox-premium-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.checkbox-premium-label:hover {
    border-color: var(--color-primary-gold);
    background: #fdfaf0;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.checkbox-premium-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary-green);
    cursor: pointer;
}

.checkbox-premium-label i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.checkbox-premium-label span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-dark);
}

/* Reward Budget Specific Styles */
.budget-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border-right: 4px solid var(--color-primary-gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.budget-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-right-color: var(--color-primary-green);
}

.budget-type-row {
    transition: background 0.2s;
}

.budget-type-row:hover {
    background: #fdfaf0;
}

.budget-type-percent:focus {
    background: #fffbeb;
    border-color: var(--color-primary-gold);
}

.budget-amount-imported {
    animation: highlightPulse 1.5s ease-out;
}

@keyframes highlightPulse {
    0% { background-color: rgba(196, 168, 130, 0.4); }
    100% { background-color: transparent; }
}

.feature-selection-card {
    transition: all 0.3s ease;
}


.feature-selection-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.feature-selection-card label input[type="checkbox"]:checked+i,
.feature-selection-card label:has(input[type="checkbox"]:checked) {
    color: var(--color-primary-green);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family-base);
}

body {
    background: #FAF6F0;
    color: var(--color-text-dark);
    direction: rtl;
    /* Right-to-Left for Arabic */
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 15px;
    /* Added top margin */
}

/* Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-primary {
    background: #3B2A15;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid #6B5540;
    font-weight: 700;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #1E1208;
    color: #ffffff !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: #C4A882;
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: #3B2A15;
}

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 3rem;
    text-align: center;
    position: relative;
    z-index: 500;
}

.brand-logo {
    max-width: 180px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.app-title {
    color: #1E1208;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 800;
}

.app-subtitle {
    color: #4A3520;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: right;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #3B2A15;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
    font-size: 1rem;
    position: relative;
    z-index: 1000;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary-gold);
    box-shadow: 0 0 0 3px rgba(198, 142, 59, 0.2);
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 15px);
    /* Adjusted for body padding-top */
}

/* Sidebar */
.sidebar {
    background: #1e1e1e;
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    text-align: center;
    margin-bottom: 3rem;
}

.sidebar-logo-img {
    max-width: 80px;
    margin-bottom: 10px;
    background: white;
    border-radius: 12px;
    padding: 5px;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.8rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 10px;
    transition: all 0.2s;
    font-size: 1.05rem;
}

.nav-link i {
    margin-left: 12px;
    color: var(--color-sidebar-orange) !important;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-primary-gold);
    backdrop-filter: blur(5px);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    height: 30px;
    width: 4px;
    background: var(--color-primary-gold);
    border-radius: 4px 0 0 4px;
}

/* Sidebar Submenu */
.nav-item-dropdown {
    position: relative;
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 5px 20px 10px 0;
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.submenu.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.submenu-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.submenu-link i {
    margin-left: 10px;
    font-size: 0.85rem;
    color: var(--color-sidebar-orange) !important;
}

.submenu-link:hover {
    color: var(--color-primary-gold);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-arrow {
    margin-right: auto;
    transition: transform 0.3s;
}

.nav-link.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dashboard Banner */
.dashboard-banner {
    width: 100%;
    margin: -2rem -2rem 2rem -2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f4f7f6;
}

.top-bar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1001;
}

.page-title h2 {
    color: var(--color-primary-green);
    font-weight: 800;
    font-size: 1.25rem;
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: var(--color-primary-gold);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.content-area {
    padding: 2rem;
    margin-top: 1rem;
    flex-grow: 1;
    overflow-y: auto;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    overflow: hidden;
    /* Prevent background from scrolling */
    justify-content: center;
    align-items: center;
    /* Center the modal content when displayed */
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 92vh;
    /* Use most of the screen height */
    display: flex;
    /* Flex layout for header/body/footer */
    flex-direction: column;
    overflow: hidden;
    /* Clip contents to body */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Custom Scrollbar for Modals and Content Area */
.modal-body::-webkit-scrollbar,
.content-area::-webkit-scrollbar {
    width: 14px;
}

.modal-body::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #C4A882;
    border-radius: 10px;
    border: 3px solid #FAF6F0;
}

::-webkit-scrollbar-thumb:hover {
    background: #AA841D;
}


.modal-header {
    background: #1E1208;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #C4A882;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.modal-header h2,
.modal-header h3,
#userModalTitle {
    color: white !important;
    margin: 0;
    flex: 1;
}

.close-btn,
.modal-close,
.btn-toggle-fullscreen {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--color-danger);
}

.btn-toggle-fullscreen:hover {
    color: var(--color-primary-green);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    /* Enable inner body scroll */
    flex: 1;
    /* Take all available space */
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid #C4A882;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #FAF6F0;
    flex: 0 0 auto;
}


/* AI Mini Buttons */
.btn-ai-mini {
    background: var(--color-sidebar-orange);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.8rem;
}

.btn-ai-mini:hover {
    background: #AA841D;
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* AI Suggestion Items */
.suggestion-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-right: 4px solid #D4AF37;
}

.suggestion-card:hover {
    background: #fdfaf0;
    border-color: #D4AF37;
    transform: translateX(-5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.suggestion-card.selected {
    background: #fef3c7;
    border-color: #D4AF37;
}

.suggestion-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #AA841D;
    margin-bottom: 5px;
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary-gold);
    box-shadow: 0 0 0 3px rgba(198, 142, 59, 0.1);
}

.form-group input.hidden,
.form-group select.hidden {
    display: none;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* Premium Table Masterpiece */
.table-premium {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.table-premium thead {
    background: var(--color-reward-dark-brown) !important;
}

.table-premium th {
    color: var(--color-reward-cyan) !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-bottom: 3px solid var(--color-reward-orange) !important;
    font-size: 0.9rem;
}

.table-premium tbody tr {
    transition: all 0.3s ease;
    background: white;
}

.table-premium tbody tr:nth-child(even) {
    background: rgba(107, 85, 64, 0.03); /* Subtle light brown tint */
}

.table-premium tbody tr:hover {
    background: rgba(1, 184, 236, 0.05) !important; /* Subtle cyan tint */
    transform: scale(1.002);
    box-shadow: inset 5px 0 0 0 var(--color-reward-orange);
}

.table-premium td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--color-text-dark);
    white-space: pre-wrap;
    word-break: break-word;
}

.table-premium td .badge-cyan {
    background: rgba(1, 184, 236, 0.1);
    color: var(--color-reward-cyan);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(1, 184, 236, 0.2);
}

.table-premium td .badge-orange {
    background: rgba(255, 157, 0, 0.1);
    color: var(--color-reward-orange);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 157, 0, 0.2);
}
    background: #FAF6F0;
    color: #3B2A15;
    border: 1px solid #C4A882;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #1E1208;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-table thead {
    background: var(--color-primary-green);
    color: white;
}

.data-table th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.institution-name-link {
    color: var(--color-primary-green);
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s;
}

.institution-name-link:hover {
    color: var(--color-primary-gold);
    text-decoration: underline;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* Searchable Select Premium Component */
.searchable-select-container {
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 2;
}

.searchable-select-input {
    padding-right: 35px !important;
    cursor: pointer;
    background-color: #fff !important;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 12px 12px;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
    margin-top: -2px;
}

.searchable-select-dropdown.show {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.searchable-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.searchable-option:hover {
    background-color: #f1f5f9;
    color: var(--color-primary-green);
}

.searchable-option.selected {
    background-color: var(--color-primary-gold);
    color: white;
}

.searchable-no-results {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Confirmation Modal */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 4000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s ease;
}

.confirm-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.confirm-dialog {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.confirm-dialog h3 {
    color: var(--color-danger);
    margin-bottom: 1rem;
}

.confirm-dialog p {
    margin-bottom: 1.5rem;
    color: var(--color-text-dark);
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}


/* Permissions Grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg-light);
    border-radius: 8px;
    margin-top: 1rem;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.permission-item label {
    cursor: pointer;
    margin: 0;
    user-select: none;
}

/* User Role Badges */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 8px;
    letter-spacing: 0.5px;
}
.role-badge.admin {
    background: #FFF9E6;
    color: #856404;
    border: 1px solid #C4A882;
    box-shadow: 0 4px 10px rgba(189, 147, 51, 0.15);
}
.role-badge.user {
    background: #F8F9FA;
    color: #495057;
    border: 1px solid #DEE2E6;
}

/* Split-Screen Layout for System Settings */
.split-screen-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 120px);
    margin: -1rem;
    /* Negate content area extra padding if needed */
}

.sidebar-panel {
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-workspace-panel {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    background: #fdfdfd;
}

.user-list-search {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.user-list-items {
    flex: 1;
    overflow-y: auto;
}

.user-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
}

.user-sidebar-item:hover {
    background: #fcfcfc;
}

.user-sidebar-item.selected {
    background: rgba(59, 42, 21, 0.05);
    border-right: 4px solid #C4A882;
    padding-right: calc(1.5rem - 4px);
}

.user-sidebar-item .user-info {
    flex: 1;
}

.user-sidebar-item .user-name {
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 2px;
}

.user-sidebar-item .user-subtext {
    font-size: 0.8rem;
    color: #888;
}

/* Permission Matrix */
.permissions-workspace {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.permission-category {
    margin-bottom: 2rem;
}

.permission-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    color: var(--color-primary-green);
    font-weight: 700;
    font-size: 1.1rem;
}

.permission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.permission-row:hover {
    background: #fafafa;
}

.permission-row .feature-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.permission-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.perm-level-select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 120px;
}

.workspace-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid #eee;
    background: #fdfdfd;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Password Help Text */
#passwordHelp {
    display: none;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Policy Document View */
.policy-document-container {
    background: #fff;
    width: 210mm;
    min-height: 297mm;
    margin: 40px auto 20px auto;
    padding: 20mm;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    color: #333;
    line-height: 1.8;
}

.policy-document-header {
    text-align: center;
    border-bottom: 2px solid var(--color-primary-green);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.policy-document-header h1 {
    color: var(--color-primary-green);
    font-size: 1.75rem;
    margin-bottom: 10px;
}

.policy-section {
    margin-bottom: 25px;
}

.policy-section h2 {
    color: var(--color-primary-green);
    font-size: 1.25rem;
    border-right: 4px solid var(--color-primary-gold);
    padding-right: 15px;
    margin-bottom: 12px;
}

.policy-content {
    font-size: 1.1rem;
    white-space: pre-wrap;
}

.policy-signature-area {
    margin-top: 50px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.signature-box {
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

.signature-box div {
    margin-bottom: 8px;
}

.signature-preview-container {
    margin-top: 10px;
    border: 1px dashed #ddd;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    background: #fdfdfd;
}

.signature-preview-img {
    max-width: 200px;
    max-height: 100px;
    display: block;
    margin: 0 auto;
}

.policy-signature-img {
    max-width: 200px;
    max-height: 80px;
    display: block;
    margin-top: 5px;
}

.policy-actions {
    position: sticky;
    top: -2rem;
    /* Sticks to the top of the content area, covering its padding */
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    gap: 10px;
    margin: -2rem -2rem 20px -2rem;
    /* Negates parent padding to stretch to edges */
    padding: 1rem 2rem;
    background: var(--color-bg-light);
    /* Matches dashboard background for seamless scroll-under */
    border-bottom: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    justify-content: flex-end;
}

/* Page Setup for Printing - Strictly Removes browser headers/footers */
@page {
    size: A4 auto;
    margin: 0mm !important;
}

@media print {

    /* Set page margins */
    @page {
        margin: 15mm !important;
    }

    /* Hide everything by default */
    body * {
        visibility: hidden !important;
    }

    /* Show only the printable document sections */
    #policyViewSection,
    #policyViewSection *,
    #strategicPlanViewSection,
    #strategicPlanViewSection *,
    #visionViewSection,
    #visionViewSection *,
    #missionViewSection,
    #missionViewSection *,
    #registryViewSection,
    #registryViewSection *,
    .policy-document-container,
    .policy-document-container *,
    .bmc-page-container,
    .bmc-page-container *,
    .bmc-canvas-wrapper,
    .bmc-canvas-wrapper * {
        visibility: visible !important;
    }

    /* Target the specific container for printing */
    .policy-document-container,
    #strategicPlanDocContent,
    #operationDesignPrintArea.show-print {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        color: black !important;
        visibility: visible !important;
    }

    /* Explicitly hide non-printable UI elements even if they are children of visible containers */
    .view-header,
    .sidebar,
    .top-bar,
    .nav-menu,
    .sidebar-footer,
    .institution-header-panel,
    .modal,
    button,
    .print-hidden {
        display: none !important;
    }

    /* Page Numbering */
    body {
        counter-reset: page;
    }

    .print-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 10pt;
        color: #666;
        padding: 5mm 0;
        visibility: visible !important;
        display: block !important;
        background: transparent !important;
    }

    .print-footer::after {
        counter-increment: page;
        content: "صفحة " counter(page);
    }

    /* Ensure parent containers permit rendering */
    body,
    html {
        background: white !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
    }

    .dashboard-layout,
    .main-content,
    .content-area,
    .view-section {
        display: block !important;
        position: static !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        visibility: visible !important;
        overflow: visible !important;
    }
}

/* AI Suggestion Styles */
.form-label-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.btn-ai-suggest {
    background: #3B2A15;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-ai-suggest:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.btn-ai-suggest i {
    font-size: 0.7rem;
}

.suggestion-box {
    background: rgba(46, 204, 113, 0.05);
    border-right: 3px solid var(--color-primary-green);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.9rem;
    position: relative;
    animation: slideInRtl 0.3s ease;
}

.suggestion-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

@keyframes slideInRtl {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
        /* Mobile menu to be implemented */
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ============================================
   NOTIFICATION SYSTEM STYLES
   ============================================ */

.notification-bell-wrapper {
    position: relative;
    margin-right: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border-radius: 50%;
    transition: all 0.3s ease;
}

[dir="rtl"] .notification-bell-wrapper {
    margin-right: 0;
    margin-left: 20px;
}

.notification-bell-wrapper:hover {
    background: #eef2f3;
    transform: scale(1.05);
}

.notification-bell-wrapper i {
    font-size: 1.2rem;
    color: var(--color-primary-green);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    /* Prevent interference with bell click */
    z-index: 5;
}

.notification-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    /* Highest priority */
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    cursor: default;
}

[dir="rtl"] .notification-dropdown {
    right: auto;
    left: 0;
}

.notification-dropdown.show {
    display: flex;
}

.notification-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-bg-light);
}

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--color-text-dark);
}

.clear-notifications {
    font-size: 0.8rem;
    color: var(--color-primary-green);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-weight: 600;
}

.clear-notifications:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    gap: 12px;
    transition: background 0.2s;
    cursor: pointer;
    position: relative;
    text-align: right;
}

.notification-item:hover {
    background: #f9f9f9;
}

.notification-item.unread {
    background: rgba(26, 77, 46, 0.03);
}

.notification-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.institution {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

.notification-icon.sub-institution {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}

.notification-content {
    flex-grow: 1;
}

.notification-message {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-dark);
    line-height: 1.4;
    font-weight: 500;
}

.notification-time {
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
    display: block;
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    align-self: center;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #ccc;
}

.notification-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.notification-empty p {
    margin: 0;
    font-size: 0.9rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Registry Card Backgrounds */
.registry-card.law {
    position: relative;
    z-index: 1;
}

.registry-card.law::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/law_bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    /* High transparency for readability */
    z-index: -1;
    transition: opacity 0.3s;
}

.registry-card.law:hover::before {
    opacity: 0.15;
}

.registry-card.law>* {
    position: relative;
    z-index: 2;
}

/* Regulation Card Background */
.registry-card.regulation {
    position: relative;
    z-index: 1;
}

.registry-card.regulation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/regulation_bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: -1;
    transition: opacity 0.3s;
}

.registry-card.regulation:hover::before {
    opacity: 0.15;
}

.registry-card.regulation>* {
    position: relative;
    z-index: 2;
}

/* Decision Card Background */
.registry-card.decision {
    position: relative;
    z-index: 1;
}

.registry-card.decision::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/decision_bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: -1;
    transition: opacity 0.3s;
}

.registry-card.decision:hover::before {
    opacity: 0.15;
}

.registry-card.decision>* {
    position: relative;
    z-index: 2;
}

/* ==================================================
   Employee Profile Report Print Styles
   ================================================== */

@media print {

    /* 
       Step 1: Hide everything by default for a clean slate, 
       then selectively unhide what we need. 
       However, unhiding a child of a hidden parent is impossible in CSS.
       So we must use the visibility: visible trick or ensure parents are visible.
    */

    /* Hide high-level UI components */
    .sidebar,
    .top-bar,
    .print-hidden,
    .btn,
    button,
    .nav-menu,
    .user-profile-menu,
    .view-section,
    /* This hides all view sections */
    #dashboardViewSection,
    #individualsViewSection {
        display: none !important;
    }

    /* 
       Step 2: Ensure the PATH to the modal is visible.
       Referencing: body > .dashboard-layout > .main-content > .content-area > #employeeProfileModal
    */
    html,
    body,
    .dashboard-layout,
    .main-content,
    .content-area {
        background: white !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
        /* Override flex/grid that might clip content */
        position: static !important;
    }

    /* Step 3: Ensure the target Modals are visible */
    #employeeProfileModal,
    #viewOperationModal,
    #viewRecordModal {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        z-index: 10000 !important;
        background: white !important;
        overflow: visible !important;
    }

    /* Ensure other modals stay hidden */
    .modal:not(#employeeProfileModal):not(#viewOperationModal):not(#viewRecordModal) {
        display: none !important;
    }

    /* Step 4: Reset Modal Internals for Print Layout */
    #employeeProfileModal .modal-content,
    #viewOperationModal .modal-content,
    #viewRecordModal .modal-content {
        box-shadow: none !important;
        border: none !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        position: static !important;
        background: white !important;
    }

    #employeeProfileModal .modal-body,
    #viewOperationModal .modal-body,
    #viewRecordModal .modal-body {
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
        background: white !important;
    }

    /* Step 5: Hide Modal controls */
    .modal-header.no-print,
    .modal-footer.no-print,
    .close-btn,
    .modal-header:has(.close-btn),
    #viewOperationModal .modal-header,
    #viewOperationModal .modal-footer,
    #viewRecordModal .modal-header,
    #viewRecordModal .modal-footer,
    #employeeProfileModal .close-btn,
    #employeeProfileModal .modal-header,
    #employeeProfileModal .modal-footer {
        display: none !important;
    }

    /* Reset premium document view for print */
    .premium-document-view {
        margin: 0 auto !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        padding: 10mm !important;
    }

    /* Step 6: Ensure Report Content is fine */
    .employee-profile-report {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    /* Step 7: Page Config */
    @page {
        margin: 1cm;
        size: auto;
    }

    /* Prevent breaking inside sections and headings */
    .doc-section,
    .fieldset-premium,
    .info-section,
    .report-header,
    .premium-document-view>div {
        page-break-inside: avoid !important;
        break-inside: avoid-page !important;
        margin-bottom: 20px !important;
    }

    /* Keep headings with their content */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    /* Prevent breaking inside grids */
    .premium-document-view>div[style*="grid"] {
        page-break-inside: avoid !important;
        break-inside: avoid-page !important;
    }

    /* Performance tables should not break inside rows */
    tr {
        page-break-inside: avoid !important;
        break-inside: avoid-page !important;
    }

    thead {
        display: table-header-group !important;
    }

    /* Step 8: Color Accuracy */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Premium Tab Navigation */
/* Premium Tab Navigation */
.tab-header {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0 !important;
    justify-content: space-between;
    /* Distribute tabs */
}

.tab-btn {
    flex: 1;
    /* Make tabs equal width */
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    padding: 15px 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px 12px 0 0;
    white-space: nowrap;
    position: relative;
    top: 2px;
}

.tab-btn:hover {
    background-color: #f1f5f9;
    color: var(--color-primary-green);
}

.tab-btn.active {
    background: #3B2A15;
    color: white;
    border-color: var(--color-primary-green);
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.btn-premium-add {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    cursor: pointer;
    margin-top: 10px;
    width: 220px !important;
    /* Increased width and forced priority */
    justify-content: center !important;
    /* Center content */
}

.btn-premium-add:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.remove-row-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    margin-top: 8px;
}

.remove-row-btn:hover {
    background: #fecaca;
    color: #dc2626;
}

/* ============================================
   SEARCHABLE DROPDOWN STYLES
   ============================================ */

.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-container input[type='text'] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    cursor: text;
    transition: all 0.2s;
}

.custom-select-container input[type='text']:focus {
    border-color: var(--color-primary-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.1);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 5px;
    display: none;
}

.custom-select-dropdown.show {
    display: block;
    animation: fadeIn 0.1s ease-out;
}

.custom-select-option {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.1s;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background-color: #f8f9fa;
}

.custom-select-option.selected {
    background-color: rgba(26, 77, 46, 0.05);
    color: var(--color-primary-green);
    font-weight: 500;
}

.custom-select-option .flag-icon {
    font-size: 1.2rem;
}

.custom-select-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

/* Scrollbar for dropdown */
.custom-select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #b3b3b3;
}

/* Job Announcement Styles */
.job-announcement-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.job-announcement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.printable-announcement {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
    border: 1px solid #efefef;
    background: white;
}

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
    }

    .content-area {
        padding: 0 !important;
        margin: 0 !important;
    }

    .view-section {
        display: none !important;
    }

    #jobDetailViewSection {
        display: block !important;
    }

    #jobDetailViewSection .view-header {
        display: none !important;
    }

    .printable-announcement {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
}

/* Premium Navigation & Action Buttons */
.premium-btn-save {
    background: #3B2A15 !important;
    color: var(--color-primary-gold) !important;
    border: 1px solid var(--color-primary-gold) !important;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(26, 77, 46, 0.2);
}

.premium-btn-save:hover {
    background: #1E1208 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 77, 46, 0.3);
    color: white !important;
}

/* Card External Buttons */
.card .btn {
    color: #000 !important;
}

.btn-outline-primary-premium {
    background: var(--color-primary-green);
    border: 1px solid var(--color-primary-gold);
    color: white !important;
}

.btn-outline-primary-premium:hover {
    background: #1E1208;
    transform: translateY(-1px);
}

/* ============================================
   GLOBAL MODAL FULLSCREEN UTILITIES
   ============================================ */
.modal-fullscreen {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 10000 !important;
}

.modal-fullscreen .modal-body {
    max-height: calc(100vh - 120px) !important;
    height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
}

/* Modal Fullscreen Toggle Button Style */
.btn-toggle-fullscreen {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #333;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
    z-index: 10001 !important;
}

.btn-toggle-fullscreen:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.modal-premium-header .btn-toggle-fullscreen,
.modal-header[style*="background"] .btn-toggle-fullscreen,
.modal-header[style*="linear-gradient"] .btn-toggle-fullscreen {
    color: white !important;
    background: none !important;
    border: none !important;
}

.modal-premium-header .btn-toggle-fullscreen:hover,
.modal-header[style*="background"] .btn-toggle-fullscreen:hover {
    background: none !important;
}

/* ============================================
   USER PERMISSIONS TABS STYLES
   ============================================ */

.perm-tabs-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.perm-tabs-nav {
    display: flex;
    gap: 4px;
    background: #FAF6F0;
    border-radius: 12px 12px 0 0;
    padding: 6px 8px 0 8px;
    border-bottom: 2px solid #C4A882;
    margin-bottom: 0;
    flex-shrink: 0;
}

.perm-tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #666;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-family-base);
}

.perm-tab-btn:hover {
    background: rgba(59, 42, 21, 0.07);
    color: #3B2A15;
}

.perm-tab-btn.active {
    background: white;
    color: #3B2A15;
    border-bottom: 3px solid #C4A882;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.perm-tab-content {
    background: white;
    border: 1px solid #C4A882;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 18px;
    overflow-y: auto;
    max-height: calc(100% - 50px);
    flex: 1;
}

/* --- Menu Permissions Tab --- */
.perm-group-section {
    margin-bottom: 18px;
    border: 1px solid #e8f0e8;
    border-radius: 10px;
    overflow: hidden;
}

.perm-group-header {
    background: #3B2A15;
    color: #C4A882;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #C4A882;
}

.perm-category-block {
    border-bottom: 1px solid #FAF6F0;
    padding: 0;
}

.perm-category-block:last-child {
    border-bottom: none;
}

.perm-category-label {
    background: #f8faf8;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-primary-green);
    border-bottom: 1px solid #e8f0e8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.perm-feature-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #f5f7f5;
    transition: background 0.15s;
    gap: 10px;
}

.perm-feature-row:last-child {
    border-bottom: none;
}

.perm-feature-row:hover {
    background: #f9fbf9;
}

.perm-parent-feature {
    background: #f2f8f2;
    padding: 10px 16px;
}

.perm-sub-feature {
    padding-right: 32px;
}

.perm-feature-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 0.9rem;
    color: var(--color-text-dark);
}

.perm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.2s;
}

.perm-sub-indent {
    color: #aaa;
    font-size: 0.85rem;
    margin-left: 4px;
}

.perm-select-wrap {
    flex-shrink: 0;
}

.perm-level-select {
    padding: 4px 10px;
    border: 1px solid #d0d9d0;
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: var(--font-family-base);
    background: white;
    color: var(--color-text-dark);
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 120px;
}

.perm-level-select:focus {
    outline: none;
    border-color: var(--color-primary-gold);
    box-shadow: 0 0 0 2px rgba(198,142,59,0.15);
}

.perm-subitems-list {
    background: white;
}

.menus-perm-actions {
    border-bottom: 1px solid #e8f0e8;
    padding-bottom: 12px;
    margin-bottom: 14px;
}

/* --- Institution Permissions Tab --- */
.inst-perm-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inst-perm-select-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #3B2A15;
    color: white;
    padding: 14px 18px;
    border-radius: 10px;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(26,77,46,0.25);
}

.inst-all-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
    flex: 1;
}

.inst-all-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary-gold);
    cursor: pointer;
    flex-shrink: 0;
}

.inst-count-badge {
    background: var(--color-primary-gold);
    color: #3B2A15;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.inst-tree-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s, pointer-events 0.3s;
}

.inst-tree-item {
    border: 1px solid #e0ece0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

.inst-tree-item:hover {
    box-shadow: 0 4px 12px rgba(26,77,46,0.1);
}

.inst-tree-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8faf8;
    cursor: pointer;
    transition: background 0.15s;
}

.inst-tree-main:hover {
    background: #f0f7f0;
}

.inst-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.inst-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary-green);
    cursor: pointer;
}

.inst-logo-mini {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    background: #e8f0e8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #d0e0d0;
}

.inst-logo-mini img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.inst-logo-mini i {
    color: var(--color-primary-green);
    font-size: 1.1rem;
}

.inst-logo-sub {
    width: 28px;
    height: 28px;
    background: #FAF6F0;
}

.inst-logo-sub i {
    font-size: 0.9rem;
    color: #A68B6A;
}

.inst-info-mini {
    flex: 1;
    min-width: 0;
}

.inst-name-mini {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inst-code-mini {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.inst-expand-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #3B2A15;
    color: #C4A882;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.2s;
    border: 1px solid #C4A882;
}

.inst-expand-btn:hover {
    background: #1E1208;
    color: #C4A882;
}

.inst-no-sub {
    font-size: 0.78rem;
    color: #aaa;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.inst-sub-list {
    border-top: 1px solid #e0ece0;
    background: white;
    animation: fadeIn 0.2s ease;
}

.inst-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 32px;
    border-bottom: 1px solid #f0f4f0;
    transition: background 0.15s;
}

.inst-sub-item:last-child {
    border-bottom: none;
}

.inst-sub-item:hover {
    background: #f9fbf9;
}

/* Role Badge */


.inst-all-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
    flex: 1;
}

.inst-all-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary-gold);
    cursor: pointer;
    flex-shrink: 0;
}

.inst-count-badge {
    background: var(--color-primary-gold);
    color: #3B2A15;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.inst-tree-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s, pointer-events 0.3s;
}

.inst-tree-item {
    border: 1px solid #e0ece0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

.inst-tree-item:hover {
    box-shadow: 0 4px 12px rgba(26,77,46,0.1);
}

.inst-tree-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8faf8;
    cursor: pointer;
    transition: background 0.15s;
}

.inst-tree-main:hover {
    background: #f0f7f0;
}

.inst-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.inst-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary-green);
    cursor: pointer;
}

.inst-logo-mini {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    background: #e8f0e8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #d0e0d0;
}

.inst-logo-mini img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.inst-logo-mini i {
    color: var(--color-primary-green);
    font-size: 1.1rem;
}

.inst-logo-sub {
    width: 28px;
    height: 28px;
    background: #f0f4f0;
}

.inst-logo-sub i {
    font-size: 0.9rem;
    color: #6c9a6c;
}

.inst-info-mini {
    flex: 1;
    min-width: 0;
}

.inst-name-mini {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inst-code-mini {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.inst-expand-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary-green);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.2s;
}

.inst-expand-btn:hover {
    background: #2e7d32;
}

.inst-no-sub {
    font-size: 0.78rem;
    color: #aaa;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.inst-sub-list {
    border-top: 1px solid #e0ece0;
    background: white;
    animation: fadeIn 0.2s ease;
}

.inst-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 32px;
    border-bottom: 1px solid #f0f4f0;
    transition: background 0.15s;
}

.inst-sub-item:last-child {
    border-bottom: none;
}

.inst-sub-item:hover {
    background: #f9fbf9;
}

/* Role Badge */


/* ============================================ */
/* PRINT STYLES - Fix for reward reports */
/* ============================================ */
@media print {
    /* Hide EVERY direct child of body except our printArea */
    body.is-printing-now > *:not(#printArea) {
        display: none !important;
    }

    #printArea {
        display: block !important;
        position: static !important;
        width: 100% !important;
        background: white !important;
    }

    #printArea .modal-content {
        border: none !important;
        box-shadow: none !important;
        max-width: 100% !important;
        width: 100% !important;
        display: block !important;
        position: static !important;
        background: white !important;
        overflow: visible !important;
    }

    /* Professional report formatting */
    .summary-card {
        page-break-inside: avoid;
        break-inside: avoid;
        border: 1px solid #ddd !important;
        margin-bottom: 10px !important;
        padding: 15px !important;
    }

    /* Hide UI buttons inside printArea */
    #printArea .modal-footer,
    #printArea .close-btn,
    #printArea .modal-premium-header button {
        display: none !important;
    }

    /* Force colors and table borders */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 20px !important;
    }

    th, td {
        border: 1px solid #ddd !important;
        padding: 10px !important;
    }

    .modal-premium-header {
        background: #3B2A15 !important;
        color: white !important;
        padding: 20px !important;
        border-bottom: 4px solid #C4A882 !important;
    }

    @page {
        margin: 1.5cm;
        size: A4 portrait;
    }
}

/* --- Advanced Employee Selector Modal (Strategic Planning) --- */
.emp-selector-modal {
    display: none;
    position: fixed;
    z-index: 4000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.emp-selector-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.emp-selector-content {
    background: white;
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border: 1px solid var(--color-primary-gold);
}

.emp-selector-header {
    background: var(--color-primary-green);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--color-primary-gold);
}

.emp-selector-header h3 {
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.emp-selector-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #f8fafc;
}

.emp-selector-search {
    margin-bottom: 20px;
    position: relative;
}

.emp-selector-search i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.emp-selector-search input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    font-size: 1rem;
    transition: all 0.3s;
}

.emp-selector-search input:focus {
    border-color: var(--color-primary-gold);
    box-shadow: 0 0 0 4px rgba(196, 168, 130, 0.15);
    outline: none;
}

.emp-table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    overflow: hidden;
}

.emp-table {
    width: 100%;
    border-collapse: collapse;
}

.emp-table th {
    background: #f1f5f9;
    padding: 12px 15px;
    text-align: right;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.emp-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.emp-table tr:hover {
    background: #fdfaf0;
}

.emp-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary-green);
    cursor: pointer;
}

.emp-selector-footer {
    padding: 20px 30px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selection-count {
    font-weight: 700;
    color: var(--color-primary-green);
    background: rgba(196, 168, 130, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.btn-confirm-selection {
    background: var(--color-primary-green);
    color: var(--color-primary-gold);
    border: none;
    padding: 10px 25px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-confirm-selection:hover {
    background: #1E1208;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.active-status-badge {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==========================================
   GANTT CHART STYLES
   ========================================== */
.gantt-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 800px; /* force horizontal scroll if needed */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 20px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.gantt-timeline-header {
    display: flex;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.gantt-task-col-header {
    width: 250px;
    flex-shrink: 0;
    padding: 15px;
    font-weight: 700;
    color: var(--color-primary-navy);
    border-left: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gantt-dates-grid {
    flex-grow: 1;
    display: grid;
}

.gantt-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    border-left: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: #64748b;
}

.gantt-day-header.gantt-weekend {
    background-color: #f1f5f9;
    color: #94a3b8;
}

.gday {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-primary-navy);
}

.gmonth {
    font-size: 0.7rem;
    opacity: 0.7;
}

.gantt-tasks-area {
    display: flex;
    flex-direction: column;
}

.gantt-row {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

.gantt-row:hover {
    background: #f8fafc;
}

.gantt-task-info {
    width: 250px;
    flex-shrink: 0;
    padding: 12px 15px;
    border-left: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gtask-name {
    font-weight: 700;
    color: var(--color-text-dark);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.gtask-assignee {
    font-size: 0.75rem;
    color: #64748b;
}

.gantt-bar-grid {
    flex-grow: 1;
    display: grid;
    position: relative;
}

.gantt-grid-cell {
    border-left: 1px dashed #e2e8f0;
    height: 100%;
}

.gantt-grid-cell.gantt-grid-weekend {
    background-color: #f8fafc;
}

.gantt-bar {
    margin-top: 10px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 5;
    transition: transform 0.2s;
}

.gantt-bar:hover {
    transform: scaleY(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.gantt-bar-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.gantt-bar-primary { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.gantt-bar-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.gantt-bar-danger  { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.gantt-bar-partial { background: repeating-linear-gradient(-45deg, #a855f7, #a855f7 8px, #8b5cf6 8px, #8b5cf6 16px); }
.gantt-bar-default { background: linear-gradient(135deg, #64748b 0%, #475569 100%); }

/* Progress overlay inside Gantt bar */
.gantt-bar {
    position: relative;
    overflow: hidden;
}

.gantt-progress-overlay {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px 0 0 6px;
    transition: width 0.5s ease;
    z-index: 1;
}

.gantt-bar-label {
    position: relative;
    z-index: 2;
}

/* Follow-up markers on the Gantt chart */
.gantt-followup-marker {
    grid-row: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 6;
    padding-bottom: 2px;
    cursor: pointer;
    transition: transform 0.2s;
}

.gantt-followup-marker i {
    color: #8b5cf6;
    font-size: 0.7rem;
    filter: drop-shadow(0 1px 2px rgba(139, 92, 246, 0.4));
    animation: markerPulse 2s infinite;
}

.gantt-followup-marker:hover {
    transform: scale(1.3);
}

.gantt-followup-marker:hover i {
    color: #6d28d9;
}

@keyframes markerPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Task progress bar in Gantt sidebar */
.gtask-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.gtask-progress-bar {
    flex-grow: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.gtask-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.gtask-progress span {
    font-size: 0.7rem;
    font-weight: 700;
    color: #6366f1;
    min-width: 30px;
    text-align: left;
}

/* =========================================================================
   Mobile Sidebar & Toggle Styles (Added for Web Mobile Responsiveness)
   ========================================================================= */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #3B2A15; /* Matching system primary dark brown */
    cursor: pointer;
    padding: 5px;
    z-index: 1002;
    transition: transform 0.2s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: inline-block;
        margin-left: 15px; /* RTL default spacing */
    }
    
    [dir="ltr"] .mobile-menu-toggle,
    .english-version .mobile-menu-toggle {
        margin-left: 0;
        margin-right: 15px;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        z-index: 9999;
        display: none !important; /* Override default layout */
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.35);
        padding: 2rem 1.5rem;
    }
    
    /* Default RTL (Arabic) */
    .sidebar {
        right: 0;
        left: auto;
    }
    
    .sidebar.mobile-active {
        display: flex !important;
        animation: slideInSidebarRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    /* LTR Override (English) */
    [dir="ltr"] .sidebar,
    .english-version .sidebar {
        left: 0;
        right: auto;
    }
    
    [dir="ltr"] .sidebar.mobile-active,
    .english-version .sidebar.mobile-active {
        display: flex !important;
        animation: slideInSidebarLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
}

@keyframes slideInSidebarRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInSidebarLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}
