@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;500;600;700&display=swap");

:root {
    --primary-color: #38E078;
    --text-color: #0D1A12;
    --light-gray: #f7fafc;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Work Sans', sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding-top: 32px;
    z-index: 100;
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    overflow-x: hidden;
    height: 100%;
}

/* Collapsed sidebar */
.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
}

@media (min-width: 992px) {
    .sidebar.collapsed {
        transform: translateX(0);
        width: 70px;
    }
    
    .sidebar.collapsed .sidebar-title,
    .sidebar.collapsed .sidebar-link span {
        display: none;
    }
    
    .sidebar.collapsed .sidebar-link {
        justify-content: center;
        padding: 12px 0;
    }
    
    .sidebar.collapsed .sidebar-link .icon {
        margin-right: 0;
        font-size: 1.4em;
    }
    
    .sidebar.collapsed .sidebar-header {
        justify-content: center;
        padding: 0 0 32px 0;
    }
}
.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 24px 32px 24px;
}
.sidebar-logo {
    height: 30px;
    margin-right: 12px;
}
.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    border-radius: 6px;
    transition: background 0.15s;
    margin-bottom: 4px;
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--primary-color);
    color: #fff;
}
.sidebar-link .icon {
    margin-right: 12px;
    font-size: 1.2em;
}

/* Footer offset for sidebar pages */
body.has-sidebar .footer {
    margin-left: 250px;
    transition: margin-left 0.3s ease-in-out;
}

body.has-sidebar.sidebar-collapsed .footer {
    margin-left: 70px;
}

/* Mobile styles */
@media (max-width: 991.98px) {
    body.has-sidebar .footer,
    body.has-sidebar.sidebar-collapsed .footer {
        margin-left: 0;
    }
}

/* Layout Container */
.layout-container {
    display: flex;
    min-height: 100vh;
    background: var(--light-gray);
}

.main-area {
    margin-left: 250px;
    flex: 1;
    max-width: calc(100vw - 250px);
    min-width: 0;
    padding: 48px 40px 32px 40px;
    transition: margin-left 0.3s ease-in-out;
    min-height: 100vh;
}

/* When sidebar is collapsed */
.main-area.sidebar-collapsed {
    margin-left: 70px;
    max-width: calc(100vw - 70px);
}

/* Mobile styles */
@media (max-width: 991.98px) {
    .main-area {
        margin-left: 0;
        max-width: 100vw;
        padding: 24px 20px;
    }

    .sidebar:not(.collapsed) + .main-area {
        margin-left: 250px;
        max-width: calc(100vw - 250px);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-area.sidebar-collapsed {
        margin-left: 0;
        max-width: 100vw;
    }

    .dashboard-section {
        overflow-x: scroll;
        width: 90vw;
    }

    .table-responsive {
        overflow-x: scroll;
        width: 80vw;
    }

    .page-title {
        font-size: 1.5rem !important;
    }
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}
.page-desc {
    color: #5b7c6c;
    font-size: 1.1rem;
    margin-bottom: 32px;
}

.flash-messages .alert {
    margin-bottom: 0;
}

/* Flash Messages Wrapper - aligns with main-area when sidebar is present */
.flash-messages-wrapper {
    width: 100%;
}

body.has-sidebar .flash-messages-wrapper {
    margin-left: 250px;
    padding: 0 40px;
    max-width: calc(100vw - 250px);
}

body.has-sidebar.sidebar-collapsed .flash-messages-wrapper {
    margin-left: 70px;
    max-width: calc(100vw - 70px);
}

@media (max-width: 991.98px) {
    body.has-sidebar .flash-messages-wrapper {
        margin-left: 0;
        padding: 0 20px;
        max-width: 100vw;
    }
}

/* Dashboard Widgets */
.dashboard-summary {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}
.summary-widget {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px 32px 16px 32px;
    min-width: 200px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 2px 4px rgba(56,224,120,0.03);
}
.summary-title {
    font-size: 1rem;
    color: #5b7c6c;
    font-weight: 500;
    margin-bottom: 12px;
}
.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}

.dashboard-section {
    overflow-x: scroll;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 28px;
    padding: 24px 24px 12px 24px;
    box-shadow: 0 2px 4px rgba(56,224,120,0.03);
}
.section-title {
    font-size: 1.08rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-color);
}
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.98rem;
}
.dashboard-table th, .dashboard-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}
.dashboard-table th {
    background: #f7fafc;
    color: #5b7c6c;
    font-weight: 600;
}
.dashboard-table tr:last-child td {
    border-bottom: none;
}
.dashboard-tasks {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dashboard-tasks li {
    margin-bottom: 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
}
.dashboard-tasks input[type="checkbox"] {
    margin-right: 10px;
    accent-color: var(--primary-color);
}
.dashboard-report-empty {
    background: #f7fafc;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 36px 18px;
    text-align: center;
}
.empty-title {
    font-size: 1.08rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.empty-desc {
    color: #5b7c6c;
    font-size: 0.98rem;
    margin-bottom: 18px;
}
.btn-upload-report {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.7;
    font-size: 0.96rem;
}
.dashboard-reports {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dashboard-reports li {
    margin-bottom: 18px;
    font-size: 0.98rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.dashboard-reports li:last-child {
    border-bottom: none;
}
.report-image {
    margin-top: 8px;
    max-width: 120px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-header p {
    color: #718096;
    font-size: 0.95rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.25rem;
}

.toggle-password:focus {
    outline: none;
    color: var(--primary-color);
}

.forgot-password {
    text-align: right;
    margin-top: 0.5rem;
}

.forgot-password a {
    color: #718096;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password a:hover {
    color: var(--primary-color);
}

.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3a56d4;
}

.btn-block {
    display: block;
    width: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #718096;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Footer Styles */
.footer {
    background-color: #ffffff;
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.footer .text-muted {
    color: #718096 !important;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links a {
    color: #4a5568;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.2s ease-in-out;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 2rem 0;
    width: 100%;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f7fafc;
    color: #4a5568;
    transition: all 0.2s ease-in-out;
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

@media (max-width: 767.98px) {
    .footer .row {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        margin: 1rem 0;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
    
    .social-links {
        margin: 1rem 0 0;
    }
}

.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    color: #e53e3e;
}

/* Filter and Sort Controls */
.filters-section {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    transition: border-color 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(56, 224, 120, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.filter-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #fff;
    text-decoration: none;
}

/* Responsive filters */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .filter-actions {
        margin-left: 0;
        justify-content: flex-start;
    }
    
    .filter-actions .btn {
        flex: 1;
    }
}