/* MoE PMS Modern Slate Theme & Responsive Grid System */

:root {
    --sidebar-w: 260px;
    --sidebar-collapsed: 78px;
    --topbar-h: 65px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Sleek Color Palette */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --success: #10b981;
    --info: #06b6d4;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Backgrounds */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    /* Light/Dark Text */
    --text-main: #0f172a;
    --text-sub: #475569;
    --text-muted: #94a3b8;
    
    /* Sleek White Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #475569;
    --sidebar-text-active: #2563eb;
    --sidebar-active-bg: #eff6ff;
    --sidebar-link-hover: #f1f5f9;

    /* Shadow system */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.04), 0 4px 6px -2px rgba(0,0,0,0.02);
    --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* ═══ TYPOGRAPHY & RESET ═══ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition);
}

/* Font assignment by document direction */
[dir="ltr"] {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
[dir="rtl"] {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', system-ui, sans-serif;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

/* ═══ APP SHELL & LAYOUT ═══ */
.app-shell {
    min-height: 100vh;
    display: flex;
}

/* --- Backdrop overlay (mobile only) --- */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}
.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* --- Sidebar (Dark Theme) --- */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: width var(--transition), transform var(--transition);
}
[dir="ltr"] .sidebar {
    left: 0;
}
[dir="rtl"] .sidebar {
    right: 0;
    border-right: none;
    border-left: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 70px;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    overflow: hidden;
    white-space: nowrap;
    transition: opacity var(--transition);
}
.sidebar-brand-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--sidebar-text-active);
    letter-spacing: 0.5px;
}
.sidebar-brand-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--sidebar-text);
}

.sidebar-collapse-btn {
    position: absolute;
    top: 22px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    z-index: 1060;
    transition: all var(--transition);
}
[dir="ltr"] .sidebar-collapse-btn {
    right: -13px;
    left: auto;
}
[dir="rtl"] .sidebar-collapse-btn {
    left: -13px;
    right: auto;
}
.sidebar-collapse-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.75rem;
    overflow-y: auto;
}

.sidebar-section-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sidebar-text);
    padding: 0.5rem 0.75rem;
    opacity: 0.5;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition);
}
.sidebar-link i {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
}
.sidebar-link:hover {
    background-color: var(--sidebar-link-hover);
    color: var(--sidebar-text-active);
}
.sidebar-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-link.active i {
    color: var(--primary);
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--sidebar-border);
}
.sidebar-link-logout {
    color: #f87171;
}
.sidebar-link-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Collapsed sidebar (Desktop view) */
@media (min-width: 992px) {
    .app-shell.sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed);
    }
    .app-shell.sidebar-collapsed .sidebar-brand-text,
    .app-shell.sidebar-collapsed .sidebar-section-label,
    .app-shell.sidebar-collapsed .sidebar-link span {
        opacity: 0;
        width: 0;
        overflow: hidden;
        pointer-events: none;
    }
    .app-shell.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        padding: 1.25rem 0.5rem;
    }
    .app-shell.sidebar-collapsed .sidebar-link {
        justify-content: center;
        padding: 0.75rem;
    }
}

/* --- App Content Area --- */
.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    transition: padding var(--transition);
}

/* Desktop layout padding offsets */
@media (min-width: 992px) {
    [dir="ltr"] .app-content {
        padding-left: var(--sidebar-w);
    }
    [dir="rtl"] .app-content {
        padding-right: var(--sidebar-w);
    }
    
    [dir="ltr"] .app-shell.sidebar-collapsed .app-content {
        padding-left: var(--sidebar-collapsed);
    }
    [dir="rtl"] .app-shell.sidebar-collapsed .app-content {
        padding-right: var(--sidebar-collapsed);
    }
}

/* --- Topbar Header --- */
.topbar {
    height: var(--topbar-h);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
}
@media (min-width: 992px) {
    .sidebar-toggle {
        display: none;
    }
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Topbar Buttons */
.topbar-lang-btn, .topbar-notif-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    height: 38px;
    min-width: 38px;
    padding: 0 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}
.topbar-lang-btn:hover, .topbar-notif-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.2);
}

.topbar-notif-btn {
    position: relative;
    padding: 0;
    width: 38px;
}
.topbar-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px white;
}

/* App Main Content Container */
.app-main {
    flex: 1;
    padding: 1.5rem;
}
@media (max-width: 576px) {
    .app-main {
        padding: 1rem;
    }
}

/* ═══ MODERN DESIGN COMPONENTS ═══ */

/* --- Filters bar container --- */
.filters-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 180px;
}
.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.filter-group select, .filter-group input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-main);
    width: 100%;
    outline: none;
    transition: all var(--transition);
}
.filter-group select:focus, .filter-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* --- Metrics Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .metric-card--wide {
        grid-column: span 2;
    }
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.metric-card-content {
    z-index: 2;
    position: relative;
}
.metric-card-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}
.metric-card-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}
.metric-card-sub {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-sub);
    margin-top: 0.5rem;
}

.metric-card-watermark {
    position: absolute;
    bottom: -15px;
    z-index: 1;
    font-size: 5rem;
    opacity: 0.05;
    transition: opacity var(--transition);
}
[dir="ltr"] .metric-card-watermark {
    right: -10px;
}
[dir="rtl"] .metric-card-watermark {
    left: -10px;
}
.metric-card:hover .metric-card-watermark {
    opacity: 0.09;
}

/* Metric Colors Override styling */
.metric-card--blue { border-left: 5px solid var(--primary); }
[dir="rtl"] .metric-card--blue { border-left: none; border-right: 5px solid var(--primary); }

.metric-card--green { border-left: 5px solid var(--success); }
[dir="rtl"] .metric-card--green { border-left: none; border-right: 5px solid var(--success); }

.metric-card--gold { border-left: 5px solid var(--warning); }
[dir="rtl"] .metric-card--gold { border-left: none; border-right: 5px solid var(--warning); }

.metric-card--pink { border-left: 5px solid var(--danger); }
[dir="rtl"] .metric-card--pink { border-left: none; border-right: 5px solid var(--danger); }

.metric-card--purple { border-left: 5px solid #8b5cf6; }
[dir="rtl"] .metric-card--purple { border-left: none; border-right: 5px solid #8b5cf6; }

.metric-card--coral { border-left: 5px solid #f97316; }
[dir="rtl"] .metric-card--coral { border-left: none; border-right: 5px solid #f97316; }

.metric-card--teal { border-left: 5px solid var(--info); }
[dir="rtl"] .metric-card--teal { border-left: none; border-right: 5px solid var(--info); }

.metric-card--grey { border-left: 5px solid var(--secondary); }
[dir="rtl"] .metric-card--grey { border-left: none; border-right: 5px solid var(--secondary); }

/* --- Dashboard Section Titles --- */
.dashboard-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 1.75rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dashboard-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

/* --- Charts Rows and Layout panels --- */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.chart-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}
.chart-panel-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.chart-panel-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.chart-panel-icon--blue { background-color: var(--primary-light); color: var(--primary); }
.chart-panel-icon--teal { background-color: rgba(6, 182, 212, 0.1); color: var(--info); }

.chart-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}
.chart-panel-body {
    position: relative;
    height: 280px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.chart-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.chart-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-sub);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
}

/* --- Map Layout Panel --- */
.map-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.map-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.map-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.map-panel-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}
.map-panel-body {
    height: 380px;
    position: relative;
}
#map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

/* --- Table Container Elements --- */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.table-responsive {
    width: 100%;
    overflow-x: auto;
}
.table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}
.table th {
    background-color: var(--bg-main);
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-main);
}
.table tr:last-child td {
    border-bottom: none;
}
.table-hover tbody tr:hover {
    background-color: rgba(248, 250, 252, 0.8);
}

/* Custom badges */
.badge-status {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
}

/* Action Buttons styling */
.action-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-sub);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-edit:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.2);
}
.btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}
.btn-approve:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}
.btn-reject:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* --- Page Header Layout --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.excel-btn {
    background-color: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.15);
    transition: all var(--transition);
}
.excel-btn:hover {
    background-color: #059669;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.25);
}

/* ═══ MODERN FORMS SYSTEMS ═══ */
.modern-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}
.modern-form .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
}
.modern-form .form-control, .modern-form .form-select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-main);
    width: 100%;
    outline: none;
    transition: all var(--transition);
}
.modern-form .form-control:focus, .modern-form .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.disabled-input {
    background-color: var(--bg-main) !important;
    color: var(--text-sub) !important;
    cursor: not-allowed;
}

/* Chip Checkbox groups */
.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.chip-option {
    cursor: pointer;
}
.chip-option input[type="checkbox"] {
    display: none;
}
.chip-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-sub);
    transition: all var(--transition);
}
.chip-option:hover .chip-label {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}
.chip-option input[type="checkbox"]:checked + .chip-label {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 3px 6px rgba(37, 99, 235, 0.15);
}

/* File Upload Field */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition);
    position: relative;
}
.file-upload-zone:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}
.file-upload-input {
    display: none;
}
.file-upload-icon {
    font-size: 2rem;
    color: var(--primary);
}
.file-upload-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
}
.file-upload-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.file-upload-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Globe and email buttons */
.globe-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--primary);
    border-radius: var(--radius-full);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}
.globe-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ═══ PROFILE LAYOUT ═══ */
.profile-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.profile-hero {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}
.profile-hero-photo {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}
.profile-hero h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
}
.profile-hero p {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin: 0;
}

.profile-form-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}
.profile-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin: 2rem 0 1rem;
}

/* ═══ AUTHENTICATION PAGES (LOGIN/REGISTER) ═══ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0f172a;
    padding: 2rem 1rem;
    background-image: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.15) 0%, transparent 40%),
                      radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 40%);
}

.auth-card-modern {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.auth-card-wide {
    max-width: 780px;
}

.auth-logo-center {
    display: block;
    width: 75px;
    height: 75px;
    object-fit: contain;
    margin: 0 auto 1rem;
}

.auth-card-modern h1 {
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    margin: 0 0 0.25rem;
    color: #0f172a;
}
.auth-sub {
    font-size: 0.8rem;
    color: #475569;
    text-align: center;
    margin-bottom: 1.75rem;
    font-weight: 500;
}

.auth-card-modern h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: #0f172a;
}
.auth-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1.25rem;
}

.input-group-modern {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group-modern i {
    position: absolute;
    color: var(--text-muted);
    font-size: 1.1rem;
}
[dir="ltr"] .input-group-modern i {
    left: 14px;
}
[dir="rtl"] .input-group-modern i {
    right: 14px;
}

.form-control-lg-custom {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}
[dir="ltr"] .input-group-modern .form-control-lg-custom {
    padding-left: 2.75rem !important;
}
[dir="rtl"] .input-group-modern .form-control-lg-custom {
    padding-right: 2.75rem !important;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 1.25rem 0;
    font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}
.auth-divider::before { margin-right: .5em; }
.auth-divider::after { margin-left: .5em; }

.auth-link {
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-lang-picker .btn {
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
}

/* ═══ LEAFLET POPUP MODERN STYLING ═══ */
.modern-popup .leaflet-popup-content-wrapper {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0;
}
.modern-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
}
.modern-popup .leaflet-popup-tip {
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.map-popup-inner {
    width: 300px;
}
.map-popup-head {
    background-color: var(--bg-main);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.map-popup-head strong {
    font-size: 0.85rem;
    font-weight: 700;
}
.map-popup-count {
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.map-popup-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.5rem;
}
.map-popup-project {
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    background-color: var(--bg-card);
}
.map-popup-project:last-child {
    margin-bottom: 0;
}
.mpp-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}
.mpp-meta {
    font-size: 0.7rem;
    color: var(--text-sub);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.15rem;
}
.mpp-budget {
    font-weight: 700;
    color: var(--success);
}
.mpp-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
}
.mpp-status--ongoing { background-color: var(--primary-light); color: var(--primary); }
.mpp-status--completed { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.mpp-status--pending { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* Marker custom styles */
@keyframes markerPulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}
.map-marker-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-marker-dot {
    width: 12px;
    height: 12px;
    background-color: var(--primary);
    border: 2px solid white;
    border-radius: var(--radius-full);
    animation: markerPulse 1.8s infinite ease-in-out;
}

/* ═══ OFF-CANVAS RESPONSIVE DRAWER ═══ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 30px rgba(15, 23, 42, 0.25);
    }
}

/* ═══ RTL SPECIFIC ALIGNMENTS AND OVERRIDES ═══ */
[dir="rtl"] .topbar-right {
    margin-left: 0;
    margin-right: auto;
}
[dir="rtl"] .topbar-left {
    margin-right: 0;
    margin-left: auto;
}
[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}
[dir="rtl"] .dropdown-menu-end {
    left: 0 !important;
    right: auto !important;
}
[dir="rtl"] .notif-dropdown {
    left: 0 !important;
    right: auto !important;
}
[dir="rtl"] .notif-dropdown li a {
    text-align: right;
}
[dir="rtl"] .text-end {
    text-align: left !important;
}
[dir="rtl"] .text-start {
    text-align: right !important;
}
[dir="rtl"] th, [dir="rtl"] td {
    text-align: right !important;
}
[dir="rtl"] .action-btns {
    justify-content: flex-start;
}
[dir="rtl"] .file-upload-hint {
    text-align: right;
}
[dir="rtl"] .dropdown-label {
    text-align: right;
}
[dir="rtl"] .modal-header .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem !important;
}
