/* Layout Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.7rem 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-logout:active {
    transform: translateY(0);
}

.btn-logout i {
    font-size: 1.1rem;
}

/* Main Container */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Styles */
.main-sidebar {
    width: 300px;
    background: white;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    height: calc(100vh - 70px);
    position: sticky;
    top: 0px;
    overflow-y: auto;
    transition: width 0.3s ease;
    overflow-x: hidden;
}

.main-sidebar.collapsed {
    width: 60px;
}

.sidebar-toggle-wrapper {
    padding: 10px;
    padding-bottom: 0;
    display: flex;
    justify-content: flex-end;
}

.main-sidebar.collapsed .sidebar-toggle-wrapper {
    justify-content: center;
    padding: 10px 0;
}

.btn-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-toggle:hover {
    transform: scale(1.1);
}

.btn-toggle img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.main-sidebar.collapsed .sidebar-nav {
    display: none;
}

.sidebar-nav {
    padding: 1rem 0;
    padding-top: 0 !important;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    margin: 0;
}

/* Sidebar Filter Item Styles */
.sidebar-item-filter {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-filter-label {
    margin-bottom: 0.75rem;
}

.sidebar-filter-label p {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-filter-control {
    width: 100%;
}

.sidebar-filter-control .multiselect {
    width: 100%;
    min-width: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-filter-control .multiselect:hover {
    border-color: #667eea;
}

.sidebar-filter-control .multiselect .dropdown-toggle {
    color: #495057;
    font-size: 0.875rem;
    padding: 0;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.sidebar-filter-control .multiselect .dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    margin-top: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    max-height: 300px;
    overflow-y: auto;
    display: none; /* Hidden by default, jQuery will override with inline styles */
}

/* Multi-select search input styling in sidebar */
.sidebar-filter-control .multiselect .multi-select-search {
    width: 100%;
    padding: 0.3rem 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.sidebar-filter-control .multiselect .multi-select-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.sidebar-filter-control .multiselect .dropdown-menu label {
    cursor: pointer;
    pointer-events: auto;
}

.sidebar-filter-control
    .multiselect
    .dropdown-menu
    label
    input[type="checkbox"] {
    cursor: pointer;
    pointer-events: auto;
    position: relative;
}

.sidebar-item-filter {
    position: relative;
}

.sidebar-item-filter .multiselect .dropdown-menu {
    position: absolute;
}

/* Time Period Radio Buttons */
.sidebar-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.sidebar-radio-label:hover {
    background-color: #f8f9fa;
}

.sidebar-radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.sidebar-radio-label span {
    font-size: 0.875rem;
    color: #495057;
}

.sidebar-radio-label input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 500;
}

#customDateInput {
    display: none;
}

.sidebar-date-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* .sidebar-date-input:hover {
    border-color: #667eea;
}

.sidebar-date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
} */

/* Eng/Nep Toggle Switch */
.sidebar-switch-wrapper {
    display: flex;
    align-items: center;
}

.sidebar-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.sidebar-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sidebar-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.sidebar-switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.sidebar-switch input:checked + .sidebar-switch-slider {
    background-color: #667eea;
}

.sidebar-switch input:checked + .sidebar-switch-slider:before {
    transform: translateX(24px);
}

.sidebar-switch input:focus + .sidebar-switch-slider {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: #f5f5f5;
}

.content-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* Search Input Styling */
.content-wrapper .form-group {
    margin-bottom: 0;
}

.content-wrapper #activity_report_search {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s ease;
    background-color: #fff;
}

.content-wrapper #activity_report_search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.content-wrapper #activity_report_search::placeholder {
    color: #6c757d;
}

/* Table Cards Styling */
.content-wrapper .row.gx-2 {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.content-wrapper .row.gx-2 > [class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.content-wrapper .card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.content-wrapper .card .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

/* Table Styling */
.content-wrapper .table-responsive {
    max-height: 56vh;
    flex: 1;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.content-wrapper .table {
    margin-bottom: 0;
    width: 100%;
}

.content-wrapper .table thead {
    background-color: #f8f9fa;
}

.content-wrapper .table thead th {
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
    white-space: nowrap;
}

.content-wrapper .table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.content-wrapper .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Page Size Selector and Pagination */
.content-wrapper #pageSizeSelectorContainer,
.content-wrapper #pageSizeSelectorContainerSecond {
    margin-bottom: 1rem;
}

.content-wrapper #pageSizeSelectorContainer .form-select,
.content-wrapper #pageSizeSelectorContainerSecond .form-select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.content-wrapper .pagination {
    margin-bottom: 0;
}

.content-wrapper .pagination .page-link {
    color: #667eea;
    border-color: #dee2e6;
    padding: 0.5rem 0.75rem;
}

.content-wrapper .pagination .page-link:hover {
    background-color: #f0f4ff;
    border-color: #667eea;
}

.content-wrapper .pagination .page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.content-wrapper .pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-sidebar {
        width: 200px;
    }

    .header-title {
        font-size: 1.2rem;
    }

    .btn-logout span {
        display: none;
    }

    .main-content {
        padding: 1rem;
    }

    /* Stack tables on smaller screens */
    .content-wrapper .row.gx-2 > [class*="col-6"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .main-container {
        flex-direction: column;
    }

    .main-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem 0;
    }

    .sidebar-item {
        flex-shrink: 0;
    }

    .header-content {
        padding: 0 1rem;
    }

    .main-content {
        padding: 1rem;
    }
}
