body {
    background-color: #e6ebf5;
    background-repeat: repeat;  /* This makes it tile */
    background-attachment: fixed;  /* Optional: keeps the background fixed while scrolling */
    margin: 0;
    padding: 0;
    padding-top: 60px;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;  /* Black for general text */
}

/* Section headers */
h1, h2, h3, h4, h5, h6 {
    color: #333;
    position: relative;
}

a {
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

.container {
    margin: 10px 50px;
}

.form {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 30px;
    animation: fadeIn 1s ease-out;
}

.list-by-year {
    margin-top: 50px;
}

/* Consolidated Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    /* margin-top: 20px;
    margin-bottom: 50px; */
    font-size: 15px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    table-layout: auto; /* Changed to auto for better content-based sizing */
}

.sticky {
    overflow: visible;
}

.sticky thead{
    position: sticky;
    top: 60px; /* Same height as your navbar */
    z-index: 100; /* Higher than the table body rows */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Optional visual */
}

.sticky thead th:first-child {
    border-top-left-radius: 10px;
}

.sticky thead th:last-child {
    border-top-right-radius: 10px;
}

thead {
    background: var(--gradient);
    color: white;
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;}

th, td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 300px; /* Maximum width for any cell */
    font-weight: 500;
    white-space: normal;
    line-height: 1;
    vertical-align: middle;
}

/* Add styles for sortable headers */
th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 25px; /* Make room for the sort icon */
    transition: all 0.3s;
}

th.sortable:hover {
    backdrop-filter: brightness(90%);
}

/* Sort icons */
th.sortable::after {
    font-size: 10px;
    content: '▲▼';
    position: absolute;
    right: 8px;
    color: rgba(255, 255, 255, 0.5);
}

th.sortable.asc::after {
    font-size: 10px;
    content: '▲';
    position: absolute;
    right: 8px;
    color: white;
}

th.sortable.desc::after {
    font-size: 10px;
    content: '▼';
    position: absolute;
    right: 8px;
    color: white;
}

/* Add sort order indicator */
th.sortable[data-sort-order]:not([data-sort-order=""]) {
    padding-right: 35px;  /* Extra space for number + arrow */
}

th.sortable[data-sort-order]:not([data-sort-order=""])::before {
    content: attr(data-sort-order);
    position: absolute;
    right: 20px;
    font-size: 10px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 50%;
    transform: translateY(-50%);
}

tbody td {
    border-bottom: 1px solid #ddd;
}

tbody tr:nth-child(even) {
    background: #f8f9fa;
}

th {
    padding: 15px 0 15px 10px;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 500;
    display: inline-block;
}

/* Price cells */
.price {
    text-align: right;
    font-family: monospace;
    white-space: nowrap;
}

/* Date cells */
.date {
    white-space: nowrap;
}

table .button {
    padding: 5px 10px;
}

.form-header {
    margin-bottom: 20px;
    text-align: center;
}

.form-header select {
    padding: 3px;
    font-size: 14px;
}

.form-header h1 {
    color: #333;
    font-size: 24px;
    margin: 0;
}

.form-section {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.form-section h2 {
    color: #444;
    font-size: 18px;
    margin: 0;
    margin-top: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.help-text {
    color: #5a5a5a;
}

.form-grid {
    display: grid;
    grid-column-gap: 25px;
    grid-row-gap: 10px;
    padding: 10px;
}

.form-item {
    margin-bottom: 0;
}

.form-item label,
.filter-item label {
    display: block;
    margin-bottom: 1px;
    color: #5a5a5a;
    font-weight: 500;
    font-size: 13px;
}

.required::after {
    content: ' *';
    color: red;
}

.form-item input,
.form-item select,
.form-item textarea,
.budget-form input,
.budget-form select,
.budget-form textarea,
.filter-item input,
.filter-item select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: #fff;
    box-sizing: border-box;
}

.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus,
.budget-form input:focus,
.budget-form select:focus,
.budget-form textarea:focus,
.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

input[type=date] {
    padding: 6px;
    font-size: 12px;
}

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

.client-select {
    display: flex;
    gap: 10px;
}

.client-select input {
    flex: 1;
    background: #f8f9fa;
}

/* Form responsive styles */
@media (max-width: 1100px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 20px;
    }
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-container {
        padding: 12px;
        margin: 8px;
    }
}

/* Buttons */
.button {
    padding: 10px 20px;
    font-size: 14px;
    /* text-transform: uppercase; */
    border-radius: 20px;
    transition: all 0.3s;
    cursor: pointer;
    background: var(--gradient);
    text-decoration: none;
    color: #fff;
    border: none;
}

.button:hover {
    filter: brightness(90%);
    color: #ffffff;
    text-decoration: none;
}

.cancel {
    background: linear-gradient(#efefef 0%, #e1e1e1 100%);
    color: #555;
    display: inline-block;
}

.cancel:hover {
    color: #333;
}

.delete {
    background: linear-gradient(#e04949 0%, #c03939 100%);
}

/* Form button groups */
.button-group {
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
    padding: 15px;
    /* background: #f8f9fa; */
    border-radius: 6px;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin: 0;
}

.filter-message {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}


.form-group {
    padding: 0;
    margin-bottom: 0;
    gap: 30px;
    display: flex;
    justify-content: center;
}

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

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 20px;
    width: 400px;
    text-align: center;
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Filters section */

.filters-section {
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    overflow-y: visible;
}

/* Toggle button styles */
.filters-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.toggle-filters {
    background: #f5f5f5;
    font-size: 15px;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background-color 0.3s;
}

.toggle-filters:hover {
    background-color: #eeeeee;
}

.toggle-filters i {
    transition: transform 0.3s ease;
}

.toggle-filters.collapsed i {
    transform: rotate(-180deg);
}

/* Collapsible section styles */
.filters-content {
    max-height: 2000px;
    transition: max-height 0.5s ease-in-out;
    overflow: visible;
}

.filters-content.collapsed {
    max-height: 0;
    overflow: hidden;
}

.entries-counter {
    text-align: left;
    color: #666;
    font-size: 0.9em;
    padding: 5px;
}

.entries-counter strong {
    color: var(--primary-color);
}

.filter-item {
    margin-bottom: 10px;
}

.filters-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 15px;
}

.search-bar {
    margin-bottom: 15px;
}

/* Detail View Styles */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 20px 0;
}

.detail-header-content {
    flex: 1;
}

.detail-header-content h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    line-height: 1.3;
    display: inline-block;
}

.detail-header-content.large-text h1 {
    font-size: 25px;
}

.detail-header-content p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-header-content.large-text p {
    font-size: 20px;
    color: black;
    font-weight: bold;
}

.detail-header-content .status-badge {
    margin-left: 4px;
}

.detail-header-actions {
    display: flex;
    gap: 10px;
    padding-left: 20px;
    align-items: flex-start;
}

.info-section {
    background: #ffffff;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.info-section h2 {
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
    font-size: 1.2em;
    margin-top: 20px;
    width: fit-content;
}

.info-section h2:nth-child(1) {
    margin-top: 0;
}

.form-section h2:nth-child(1) {
    margin-top: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.info-item {
    margin-bottom: 8px;
}

.info-item label {
    font-weight: bold;
    color: #666;
    display: block;
    margin-bottom: 2px;
    font-size: 0.9em;
}

.info-item p {
    margin: 0;
    color: #333;
    font-size: 1.0em;
}

.full-width {
    grid-column: 1 / -1;
}

.text-block {
    white-space: pre-line;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 1.0em;
    line-height: 1.5;
    margin: 0;
}

.summary-box {
    background: #fff;
    border: 1px solid black;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.summary-item {
    text-align: center;
}

.summary-item label {
    font-size: 0.9em;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.summary-item .value {
    font-size: 1.2em;
    font-weight: 500;
    color: #333;
}

.table-section {
    margin-top: 20px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.price-cell {
    text-align: right;
}


.no-data {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
    background: white;
}

.stats-header h2 {
    margin-bottom: 10px;
}

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

.filter-item {
    display: flex;
    flex-direction: column;
    position: relative;
}

.filter-item label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.filter-item input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-item select {
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    height: 34px;  /* Fixed height when collapsed */
    transition: all 0.3s ease;
}

.filter-item select[multiple] {
    overflow-y: hidden;
}

.filter-item select[multiple]:focus {
    height: 300px;  /* Height when expanded */
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Styling for selected options */
.filter-item select[multiple] option {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-item select[multiple] option:checked {
    background: #f1f1f1;
}

.filter-item select[multiple] option[value=""]:checked {
    background: none;
}

/* Custom scrollbar for select elements */
.filter-item select[multiple]::-webkit-scrollbar {
    width: 8px;
}

.filter-item select[multiple]::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.filter-item select[multiple]::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.filter-item select[multiple]::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Add styles for select padding container */
select[multiple] {
    position: relative;
}
select[multiple] option:last-child {
    margin-bottom: 70vh; /* Add significant bottom padding to allow scrolling */
}

/* Selected options counter */
.filter-item {
    position: relative;
}

.selected-count {
    position: absolute;
    right: 8px;
    top: 33px;
    background: var(--gradient);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    pointer-events: none;
    display: none;
}


.link:hover {
    text-decoration: underline;
}

/* Switch toggle styles */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background: white;
    transition: .4s;
}

input:checked + .slider {
    background: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.filter-message {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

.bad { background: #ffebee; color: #c62828; }

.stats-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-header {
    text-align: center;
    margin-bottom: 20px;
}

.stats-header h6 {
    color: #666;
    margin: 0;
    font-size: 0.9em;
}

.chart-container {
    height: 400px;
    margin: 20px 0;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.total-row {
    text-align: left;
    margin: 10px 0;
    font-weight: bold;
}

.stats-section td:first-child {
    font-weight: bold;
}

th a {
    color: #fff;
}

th a:hover {
    color: #fff;
}