:root {
    --primary-color: #2e7d32;
    --secondary-color: #81c784;
    --light-color: #e8f5e9;
    --dark-color: #1b5e20;
    --accent-color: #ffd54f;
    --danger-color: #f44336;
    --success-color: #4caf50;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-color);
    color: #333;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Group logo and text */
.header-left {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo styling */
header .logo {
    height: 40px;
    width: auto;
    margin-right: 1rem;
}

/* Modern header title styling */
header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}
header p {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
}

nav {
    background-color: var(--dark-color);
    display: flex;
    justify-content: center;
}

nav button {
    background-color: transparent;
    border: none;
    color: white;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

nav button:hover, nav button.active {
    background-color: var(--primary-color);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.section {
    display: none;
    background-color: white;
    border-radius: 5px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.section.active {
    display: block;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input, select, textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 1rem;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--dark-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

th {
    background-color: var(--secondary-color);
    color: var(--dark-color);
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

.chart-container {
    height: 300px;
    margin-top: 1rem;
}

.summary-card {
    background-color: var(--light-color);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 3px;
}

.alert {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 3px;
    color: white;
    background-color: var(--danger-color);
    list-style: none;
}

.alert.success {
    background-color: var(--success-color);
}

.alert.warning {
    background-color: #ff9800;
}

.alert.info {
    background-color: #2196F3;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-card {
    background-color: white;
    border-radius: 5px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dashboard-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.big-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark-color);
}

.warning {
    color: #ff9800;
}

.danger {
    color: var(--danger-color);
}

.debug-info {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 10px;
    margin-top: 20px;
    border-radius: 5px;
    font-family: monospace;
}

#notifications {
    margin-bottom: 1rem;
}

#notifications ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#notifications li {
    margin-bottom: 0.5rem;
}

#notifications li:last-child {
    margin-bottom: 0;
}

/* Calendar container styling */
#calendar {
    width: 100%;
    max-width: 100%;
    margin: 1.5rem auto;
    background-color: white;
    border-radius: 5px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow-x: auto;
}

/* Responsive calendar on mobile */
@media (max-width: 768px) {
    #calendar {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    .fc .fc-col-header-cell-cushion,
    .fc .fc-daygrid-day-number {
        font-size: 0.7rem;
        padding: 0.2rem;
    }
}

@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
    }
    nav button {
        flex: 1 0 33%;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive tables on mobile */
@media (max-width: 768px) {
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    th, td {
        white-space: nowrap;
    }
}

/* Override global mobile table styling for FullCalendar */
@media (max-width: 768px) {
    /* Restore table display inside calendar */
    #calendar table {
        display: table !important;
        width: 100% !important;
        overflow: visible !important;
    }
    /* Restore normal wrap for calendar cells */
    #calendar th, #calendar td {
        white-space: normal !important;
    }
    /* Adjust calendar header and day numbers */
    #calendar .fc-col-header-cell-cushion,
    #calendar .fc-daygrid-day-number {
        font-size: 0.9rem !important;
        padding: 0.3rem !important;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.modal-header h2 {
    color: var(--primary-color);
    margin: 0;
    border: none;
}

.modal-body {
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-footer {
    text-align: right;
}

.modal-footer button {
    padding: 8px 16px;
    margin-left: 10px;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 20% auto;
        width: 90%;
    }
}

footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}

footer p {
    margin: 0;
    opacity: 0.9;
}

.export-buttons {
    margin: 1rem 0;
    display: flex;
    gap: 0.5rem;
}

.btn-export {
    background-color: var(--accent-color);
    color: var(--dark-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export:hover {
    background-color: #ffc107;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
}
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    nav {
        display: none;
        flex-direction: column;
        align-items: flex-start;
    }
    nav.open {
        display: flex;
    }
    nav button {
        width: 100%;
        text-align: left;
    }
}
