/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Layout Structure */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sidebar-header p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.main-content {
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active .nav-link {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-right: 3px solid #4fc3f7;
}

.nav-icon {
    margin-right: 1rem;
    font-size: 1.2rem;
}

.nav-text {
    flex: 1;
    font-weight: 500;
}

.nav-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.nav-item.has-submenu.open .nav-arrow {
    transform: rotate(180deg);
}

/* Submenu */
.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(0, 0, 0, 0.1);
}

.nav-item.has-submenu.open .submenu {
    max-height: 300px;
}

.submenu li {
    margin: 0;
}

.submenu a {
    display: block;
    padding: 0.8rem 1.5rem 0.8rem 4rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.submenu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background-color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e3f2fd;
}

.content-header h1, .content-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1565c0;
}

.user-info {
    font-weight: 500;
    color: #666;
}

/* Cards Section */
.cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #e3f2fd;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card-content h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 500;
}

.card-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1565c0;
}

/* Status Cards */
.status-cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid;
}

.status-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.status-card.red {
    border-left-color: #f44336;
}

.status-card.orange {
    border-left-color: #ff9800;
}

.status-card.blue {
    border-left-color: #2196f3;
}

.status-card.green {
    border-left-color: #4caf50;
}

.status-card.purple {
    border-left-color: #9c27b0;
}

/* Current Status Section */
.current-status {
    margin-bottom: 2rem;
}

.status-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.performance-stats,
.notifications {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.performance-stats h2,
.notifications h2 {
    color: #1565c0;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Stats Table */
.stats-table {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1px;
    background-color: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.table-header {
    display: contents;
}

.table-header .table-cell {
    background-color: #1565c0;
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: center;
}

.table-row {
    display: contents;
}

.table-cell {
    background-color: white;
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.table-row:nth-child(even) .table-cell {
    background-color: #f8f9fa;
}

/* Notifications */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1565c0;
}

.notification-text {
    font-weight: 500;
    color: #333;
}

.notification-count {
    background-color: #1565c0;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Historical Performance */
.historical-performance {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.historical-performance h2 {
    color: #1565c0;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 400px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
}

.chart-container::after {
    content: "Performance Chart Placeholder";
    color: #666;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Form Styles */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.form-title {
    color: #1565c0;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-description {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.form-grid {
    display: grid;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: " *";
    color: #f44336;
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #1565c0;
}

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

.form-section {
    border: 2px solid #e3f2fd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section-title {
    color: #1565c0;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #1565c0;
    color: white;
}

.btn-primary:hover {
    background-color: #0d47a1;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #bdbdbd;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #388e3c;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Data Grid */
.data-grid-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.grid-title {
    color: #1565c0;
    font-size: 1.3rem;
    font-weight: 600;
}

.data-grid {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.data-grid th {
    background-color: #1565c0;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.data-grid td {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.data-grid tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-grid tr:hover {
    background-color: #e3f2fd;
}

/* Action Dropdown */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background-color: #1565c0;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
}

.dropdown-content a {
    color: #333;
    padding: 0.8rem 1rem;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.action-dropdown:hover .dropdown-content {
    display: block;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    background-color: white;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background-color: #1565c0;
    color: white;
    border-color: #1565c0;
}

.pagination-btn.active {
    background-color: #1565c0;
    color: white;
    border-color: #1565c0;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

/* .modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2001;
} */

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.modal-title {
    color: #1565c0;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

/* Filter Section */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.filter-title {
    color: #1565c0;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Map Container */
.map-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.map-placeholder {
    height: 500px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #1565c0;
    color: #1565c0;
    font-size: 1.2rem;
    font-weight: 500;
}

trix-editor.required::after {
    content: none; /* Removes the asterisk */
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .status-row {
        grid-template-columns: 1fr;
    }
    
    .cards-section {
        grid-template-columns: 1fr;
    }
    
    .status-cards-section {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .data-grid {
        font-size: 0.9rem;
    }
    
    .data-grid th,
    .data-grid td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .card-number {
        font-size: 2rem;
    }
    
    .modal {
        width: 95%;
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.status-card,
.form-container,
.data-grid-container {
    animation: fadeIn 0.5s ease-out;
}

/* Print Styles */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .btn,
    .action-dropdown {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .card,
    .status-card,
    .form-container,
    .data-grid-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

.hr{
    margin-top: -1rem
}

.form-input.required::after {
    content: none; /* Removes the asterisk */
}
.form-control.required::after {
    content: none; /* Removes the asterisk */
}

.tox-statusbar__right-container, .tox-statusbar__branding, .tox-promotion{
    display: none !important;
}


 /* Timeline container */
        .timeline {
            position: relative;
            padding: 2rem 0;
        }

        /* vertical line */
        .timeline::before {
            content: "";
            position: absolute;
            top: 0;
            bottom: 0;
            left: 50%;
            width: 2px;
            background: #e9ecef;
            transform: translateX(-50%);
            z-index: 0;
        }

        /* Each timeline item */
        .timeline-item {
            position: relative;
            margin: 1.5rem 0;
            z-index: 1;
        }

        /* icon / marker */
        .timeline-icon {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
            font-size: 1.05rem;
        }

        /* content card */
        .timeline-content {
            background: white;
            border: 1px solid #e9ecef;
            border-radius: .5rem;
            padding: 1rem;
            box-shadow: 0 6px 18px rgba(0, 0, 0, .03);
        }

        /* connector from icon to vertical line */
        .timeline-connector {
            position: absolute;
            top: 1.25rem;
            /* aligns with icon center */
            width: calc(50% - 48px / 2 - 1rem);
            height: 2px;
            background: #e9ecef;
            z-index: 0;
        }

        /* for left-side items */
        .timeline-item-left .timeline-connector {
            left: calc(50% + 48px / 2 + 0.5rem);
        }

        /* for right-side items */
        .timeline-item-right .timeline-connector {
            right: calc(50% + 48px / 2 + 0.5rem);
        }

        /* place content appropriately on larger screens */
        @media (min-width: 768px) {
            .timeline-item {
                display: flex;
                align-items: flex-start;
            }

            .timeline-item-left {
                justify-content: flex-start;
                padding-right: 2rem;
            }

            .timeline-item-right {
                justify-content: flex-end;
                text-align: right;
                padding-left: 2rem;
            }

            .timeline-item-left .timeline-content {
                margin-left: 1rem;
            }

            .timeline-item-right .timeline-content {
                margin-right: 1rem;
            }

            /* hide vertical line center overlapping content */
            .timeline::before {
                left: 50%;
            }
        }

        /* small screens: stack vertically with icon on left */
        @media (max-width: 767.98px) {
            .timeline::before {
                left: 20px;
            }

            .timeline-item {
                padding-left: 56px;
            }

            .timeline-item .timeline-icon {
                position: absolute;
                left: 0;
                top: 0.25rem;
            }

            .timeline-connector {
                display: none;
            }

            /* not needed on stacked layout */
            .timeline-item .timeline-content {
                margin-left: 0;
            }

            .timeline-content h5 {
                padding-left: 3rem;
            }
        }