:root {
    --primary-color: #0d8abc;
    /* ROP Blue/Brand */
    --secondary-color: #1e293b;
    --bg-color: #f3f4f6;
    --white: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;

    /* Status Colors */
    --green: #10b981;
    --green-light: #d1fae5;
    --red: #ef4444;
    --red-light: #fee2e2;
    --orange: #f59e0b;
    --orange-light: #fef3c7;
    --blue: #3b82f6;
    --blue-light: #dbeafe;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius-lg: 16px;
    --radius-md: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.5;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--white);
    border-left: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.logo-area {
    margin-bottom: 3rem;
    text-align: center;
}

.logo-area h2 {
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.logo-area .subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--blue-light);
    color: var(--primary-color);
}

.nav-item i {
    font-size: 1.25rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.header-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-display {
    background: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn:hover {
    opacity: 0.9;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

/* Cards & Layout Shared */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Executive Summary */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 0.2rem;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-trend.positive {
    color: var(--green);
}

.stat-trend.negative {
    color: var(--red);
}

.stat-trend.neutral {
    color: var(--text-secondary);
}

/* Color Utilities */
.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

.text-orange {
    color: var(--orange);
}

.text-blue {
    color: var(--blue);
}

.bg-green-light {
    background-color: var(--green-light);
}

.bg-red-light {
    background-color: var(--red-light);
}

.bg-orange-light {
    background-color: var(--orange-light);
}

.bg-blue-light {
    background-color: var(--blue-light);
}

/* Middle Section */
.middle-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .middle-section {
        grid-template-columns: 1fr;
    }
}

.map-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    position: relative;
    min-height: 300px;
}

.oman-svg {
    height: 250px;
    width: auto;
}

.map-pin {
    cursor: pointer;
    transition: r 0.3s;
}

.map-pin:hover {
    r: 8;
    stroke: #fff;
    stroke-width: 2px;
}

.map-legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.green {
    background: var(--green);
}

.dot.orange {
    background: var(--orange);
}

.dot.red {
    background: var(--red);
}

/* Bottom Section */
.bottom-section {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .bottom-section {
        grid-template-columns: 1fr;
    }
}

/* Timeline */
.timeline {
    position: relative;
    border-right: 2px solid var(--border-color);
    padding-right: 1.5rem;
    margin-right: 0.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    right: -24px;
    /* Adjust based on border + padding */
    top: 0;
    width: 14px;
    height: 14px;
    background: var(--white);
    border: 3px solid var(--border-color);
    border-radius: 50%;
    z-index: 1;
}

.timeline-item.completed .timeline-marker {
    border-color: var(--green);
    background: var(--green);
}

.timeline-item.active .timeline-marker {
    border-color: var(--primary-color);
    background: var(--white);
}

.timeline-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.timeline-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar-mini {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar-mini .fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
}

/* Risk List */
.risk-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.risk-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid #f1f5f9;
}

.risk-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.risk-details {
    flex: 1;
}

.risk-details h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.risk-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-red {
    background: var(--red-light);
    color: var(--red);
}

.badge-orange {
    background: var(--orange-light);
    color: var(--orange);
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Map Popup Styles (Migrated from maps.html) */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    text-align: right;
}

.popup-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #1e293b;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.popup-info {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 2px;
}

.popup-progress {
    margin-top: 8px;
}

.progress-bar-bg {
    background: #e2e8f0;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    background: #14b8a6;
    height: 100%;
}