/* Custom Button Start */
.custom-button {
    font-family: 'Sofia Pro';
    font-size: 15px;
    font-weight: 400;
    color: #fff;
    line-height: 18px;
    padding: 8px 19px 9px;
    background-color: #159C2A;
    border-radius: 5px;
    cursor: pointer;
}

.custom-button:hover {
    background-color: #232323;
}

.edit-expense {
    cursor: pointer;
    padding: 5px;
}

.edit-expense:hover svg path {
    fill: #159C2A;
}
/* Custom Button End */

/* Year Dropdown Start */
.year-selector {
	display: flex;
	align-items: center;
	justify-content: space-around;
	gap: 10px;
	cursor: pointer;
	padding: 10px;
	border-radius: 3px;
	width: 120px;
	background: #f9f9f9;
	position: relative;
	user-select: none;
}

.year-selector svg {
	pointer-events: none;
}

.year-selector-dropdown ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.year-selector-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	background: #f9f9f9;
	width: 100%;
	z-index: 10;
	border-radius: 5px;
	display: none;
}

.year-selector-dropdown ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.year-selector-dropdown li {
	color: #071c0c;
	font-family: 'Sofia Pro';
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	font-size: 13px;
}

.year-selector-dropdown.active {
	display: block;
}

.year-selector-dropdown li:hover {
	background-color: #f0f0f0;
}

.year-selector-selected {
	color: #071c0c;
	font-family: 'Sofia Pro';
	font-size: 13px;
	font-style: normal;
	font-weight: 400;
	line-height: normal;
	text-transform: lowercase;
	margin-bottom: 0;
}
/* Year Dropdown End */

/* Custom Table Start */
.custom-table {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
}

.custom-table__row {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(1, 1fr);
}

.custom-table__col {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 20px;
    background-color: #fff;
    border-width: 1px 0 0 1px;
    border-style: solid;
    border-color: #E8E9E8;
    min-height: 44px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-table__row:hover .custom-table__col {
    background-color: #ecfeee;
}

.custom-table__row.expanded .custom-table__col {
    background-color: #F9F9F9;
}

.custom-table__row:first-child .custom-table__col {
    background-color: #F9F9F9;
    text-align: center;
    justify-content: center;
}

.custom-table__col:last-child {
    border-right-width: 1px;
    text-align: center;
    justify-content: center;
}

.custom-table__row:last-child .custom-table__col {
    border-bottom-width: 1px;
}

.custom-table__content {
    font-size: 15px;
    line-height: 20px;
    font-family: 'Sofia Pro';
    font-style: normal;
    font-weight: 400;
    color: #232323;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-table__content.uppercase {
    text-transform: uppercase;
}

.custom-table__content.semibold {
    font-weight: 400;
    font-family: 'Sofia Pro';
}

.custom-table__content.bold {
    font-weight: 700;
}

.custom-table__content.negative {
    color: #D62E2E;
}

.custom-table__content.positive {
    color: #159C2A;
}

.custom-table__content.underline {
    text-decoration: underline;
}

.custom-table__row:first-child .custom-table__content {
    font-weight: 500;
    color: #868686;
}

.custom-table--borderless .custom-table__col {
    border-width: 0 0 1px 0;
    padding-inline: 0;
}

.custom-table--borderless .custom-table__col:first-child {
    padding-inline-start: 25px;
}

.custom-table--borderless .custom-table__col:last-child {
    text-align: start;
    justify-content: flex-end;
}

.custom-table--borderless .custom-table__row:first-child .custom-table__col {
    font-family: 'Sofia Pro-M';
    font-weight: 500;
    font-size: 16px;
    text-align: start;
    justify-content: flex-start;
}
/* Custom Table End */

/* Revenue Styles Start */
#totalRevenueRowTrigger .custom-table__col:first-child {
    cursor: pointer;
    user-select: none; 
}

#totalRevenueRowTrigger.expanded .revenue-arrow {
    transform: rotate(180deg);
}

.revenue-arrow {
    display: inline-flex;
    margin-left: 8px;
}

.sub-category-content {
    font-size: 14px;
}
/* Revenue Styles End */

/* New Code Start */
.pal__main {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pal__block {
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    background-color: #fff;
}

.pal__block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pal__block-header.justify-content-end {
    justify-content: flex-end;
}

.pal__block-title {
    font-family: 'Sofia Pro';
    font-style: normal;
    font-weight: 400;
    font-size: 27px;
    line-height: 38px;
    color: #071C0C;
    text-transform: capitalize;
}

.pal__table-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.pal__table {
    min-width: 1040px;
}

.pal__table-dates .custom-table__row {
    grid-template-columns: 150px repeat(13, minmax(100px, 1fr));
}

.pal__table-dates .custom-table__col {
    padding: 10px;
}

.pal__table-info .custom-table__row {
    grid-template-columns: 1fr 1fr 1fr 1fr 2.6fr 30px;
}

.pal__table-dates .custom-table__content {
    font-size: 14px;
}

.pal__table-dates .sub-category-content {
    font-size: 13.5px;
}

@media (min-width: 1581px) and (max-width: 1780px) {
    .pal__table-dates .custom-table__row {
        grid-template-columns: 130px repeat(13, minmax(80px, 1fr));
    }

    .pal__table-dates .custom-table__col {
        padding: 10px 5px;
    }

    .pal__table-dates .custom-table__content {
        font-size: 13px;
    }

    .pal__table-dates .sub-category-content {
        font-size: 12px;
    }
}

@media (min-width: 1500px) and (max-width: 1580px) {
    .pal__table-dates .custom-table__row {
        grid-template-columns: 120px repeat(13, minmax(80px, 1fr));
    }

    .pal__table-dates .custom-table__col {
        padding: 10px 5px;
    }

    .pal__table-dates .custom-table__content {
        font-size: 12px;
    }

    .pal__table-dates .sub-category-content {
        font-size: 11px;
    }
}
/* New Code End */

/* Popup Add Expense Start */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Затемнення фону */
    display: none; /* Сховано за замовчуванням */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Added for centering content in viewport with scroll */
    overflow-y: auto; 
    padding-top: 20px;
    padding-bottom: 20px;
}

.popup-content {
    background-color: #ffffff;
    padding: 20px 20px 40px;
    border-radius: 3px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 658px;
    position: relative;
    /* Added for when content is longer than viewport height with padding */
    margin: auto;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee; /* Added a subtle separator */
}

.popup-header h2 {
    margin: 0;
    font-size: 18px;
    line-height: 25px;
    font-family: 'Sofia Pro', sans-serif; /* Added fallback */
    font-weight: 400;
    color: #232323;
}

.close-popup-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup-btn:hover svg path {
    fill: #D62E2E;
}

#expense-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative; /* For error message positioning */
}

.form-group label {
    display: block;
    font-size: 16px;
    color: #232323CC;
    font-family: 'proxima_nova', sans-serif; /* Added fallback */
    font-weight: 400;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%; /* Ensures it takes full width of its parent */
    padding: 12px 10px;
    border: 1px solid #D0D3D1;
    border-radius: 3px;
    font-size: 16px;
    color: #232323;
    font-family: 'proxima_nova', sans-serif; /* Added fallback */
    font-weight: 400;
    box-sizing: border-box; /* Important for width calculation */
}

.form-group select {
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.41 0.589996L6 5.17L10.59 0.589996L12 2L6 8L0 2L1.41 0.589996Z' fill='%23232323' fill-opacity='0.8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px; /* Make space for the arrow */
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder,
.form-group select option[value=""] { /* Placeholder styling for select */
    color: #232323CC;
    opacity: .7;
}
.form-group select:invalid { /* Styles the select when the disabled option is selected */
    color: #232323CC;
    opacity: .7;
}


.form-group textarea {
    min-height: 85px;
    resize: vertical;
    padding: 10px;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #159C2A;
    outline: none;
}

/* This class is no longer used for the primary layout of these fields, 
   but can be kept if you use it elsewhere or for future side-by-side needs.
.form-group-inline {
    display: flex;
    justify-content: space-between;
    gap: 25px;
}

.form-group-inline .form-group {
    width: 50%;
}
*/

.form-group input[type="text"].flatpickr-input { /* For Payment Date */
    background-image: url("data:image/svg+xml,%3Csvg width='19' height='21' viewBox='0 0 19 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5 9.5H4.5V11.5H6.5V9.5ZM10.5 9.5H8.5V11.5H10.5V9.5ZM14.5 9.5H12.5V11.5H14.5V9.5ZM16.5 2.5H15.5V0.5H13.5V2.5H5.5V0.5H3.5V2.5H2.5C1.39 2.5 0.51 3.4 0.51 4.5L0.5 18.5C0.5 19.0304 0.710714 19.5391 1.08579 19.9142C1.46086 20.2893 1.96957 20.5 2.5 20.5H16.5C17.6 20.5 18.5 19.6 18.5 18.5V4.5C18.5 3.4 17.6 2.5 16.5 2.5ZM16.5 18.5H2.5V7.5H16.5V18.5Z' fill='%23232323' fill-opacity='0.8'/%3E%3C/svg%3E%0A");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px; /* Make space for calendar icon */
}

.char-counter-container {
    font-size: 12px;
    line-height: 15px;
    color: #232323;
    font-family: 'proxima_nova', sans-serif; /* Added fallback */
    font-weight: 400;
    margin-top: -4px; /* Adjust as needed */
}

.form-actions {
    text-align: center; /* Centers the button */
    margin-top: 10px; /* Adds some space above the button */
}

.custom-button.add-expense-submit-btn { /* Ensure your button styles apply */
    padding: 10px 20px;
    background-color: #159C2A;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    min-width: 200px;
}
.custom-button.add-expense-submit-btn:hover {
    background-color: #128123;
}


/* Error Styling */
.form-group input.input-error,
.form-group textarea.input-error,
.form-group select.input-error {
    border-color: #D62E2E !important; /* Use important if other styles override */
}

.error-message {
    display: block;
    color: #D62E2E;
    font-size: 12px;
    line-height: 16px;
    position: absolute;
    top: calc(100% + 2px); /* Position below the input field */
    left: 0;
    font-family: 'proxima_nova', sans-serif; /* Added fallback */
}


/* Flatpickr Styles (ensure these are loaded and correct if you customize Flatpickr) */
.flatpickr-calendar {
    padding: 20px 15px;
    border-radius: 3px;
    font-family: 'Sofia Pro-M', sans-serif; /* Added fallback */
    font-weight: 500;
    box-shadow: 0px 7px 13px 0px #0000001A;
    transition: unset !important;
    animation: unset !important;
}
/* ... other flatpickr styles from your original file ... */
.flatpickr-calendar .flatpickr-rContainer {
    width: 100%;
}
.flatpickr-weekdays {
    height: auto;
    margin-bottom: 10px;
}
.flatpickr-weekdays .flatpickr-weekdaycontainer {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
span.flatpickr-weekday {
    color: #000;
    font-weight: 500;
    font-size: 12px;
    line-height: 18px;
    font-family: 'Sofia Pro-M', sans-serif;
    text-transform: uppercase;
}
.flatpickr-days {
    width: 100%;
}
.dayContainer {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 10px;
    width: 100%;
    min-width: unset;
    max-width: unset;
}
.flatpickr-day {
    padding: 0;
    height: 18px;
    line-height: 1;
    width: 100%;
    border-radius: 3px;
    max-width: unset;
    color: #000;
    font-size: 12px;
    background: transparent;
    border: none;
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.inRange, .flatpickr-day.startRange.inRange, .flatpickr-day.endRange.inRange, .flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus, .flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover, .flatpickr-day.selected.prevMonthDay, .flatpickr-day.startRange.prevMonthDay, .flatpickr-day.endRange.prevMonthDay, .flatpickr-day.selected.nextMonthDay, .flatpickr-day.startRange.nextMonthDay, .flatpickr-day.endRange.nextMonthDay {
    background: #159C2A;
    border-color: #159C2A;
    color: #fff;
}
.flatpickr-day.today {
    border-color: #bbb; /* Example: a light border for today */
    color: #159C2A; /* Highlight today's number */
}
.flatpickr-day.today:hover {
    background: #e9e9e9;
    color: #159C2A;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    opacity: .3;
    color: #000;
}
.flatpickr-months {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.flatpickr-months .flatpickr-month {
    height: 21px;
}
.flatpickr-current-month {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    padding: 0;
    font-size: 14px;
    color: #000;
    line-height: 21px;
    width: auto;
    text-align: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none; /* remove border from year input */
    background: transparent; /* remove background from year input */
    font-weight: bold; /* make month/year bold */
}
.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month input.cur-year:hover,
.flatpickr-current-month .numInputWrapper:hover {
    background: transparent;
}
.flatpickr-current-month .numInputWrapper span.arrowUp:after {
    border-bottom-color: #000;
}
.flatpickr-current-month .numInputWrapper span.arrowDown:after {
    border-top-color: #000;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    position: unset;
    padding: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 9px;
    width: 8px;
    height: 14px;
    top: auto; /* Reset Flatpickr defaults */
    transform: none; /* Reset Flatpickr defaults */
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    display: none; /* Hide default SVGs */
}
.flatpickr-months .flatpickr-prev-month {
    background-image: url("data:image/svg+xml,%3Csvg width='9' height='15' viewBox='0 0 9 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.22217 2.53293L3.75637 7.5L8.22217 12.4671L6.84398 14L0.999944 7.5L6.84398 1L8.22217 2.53293Z' fill='%238B928C' stroke='white' stroke-width='0.5'/%3E%3C/svg%3E%0A");
}
.flatpickr-months .flatpickr-next-month {
    background-image: url("data:image/svg+xml,%3Csvg width='9' height='15' viewBox='0 0 9 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.777832 2.53293L5.24363 7.5L0.777832 12.4671L2.15602 14L8.00006 7.5L2.15602 1L0.777832 2.53293Z' fill='%238B928C' stroke='white' stroke-width='0.5'/%3E%3C/svg%3E%0A");
}
.flatpickr-months .flatpickr-prev-month:hover {
    background-image: url("data:image/svg+xml,%3Csvg width='9' height='15' viewBox='0 0 9 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.22217 2.53293L3.75637 7.5L8.22217 12.4671L6.84398 14L0.999944 7.5L6.84398 1L8.22217 2.53293Z' fill='%23000000' stroke='white' stroke-width='0.5'/%3E%3C/svg%3E%0A");
}
.flatpickr-months .flatpickr-next-month:hover {
    background-image: url("data:image/svg+xml,%3Csvg width='9' height='15' viewBox='0 0 9 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.777832 2.53293L5.24363 7.5L0.777832 12.4671L2.15602 14L8.00006 7.5L2.15602 1L0.777832 2.53293Z' fill='%23000000' stroke='white' stroke-width='0.5'/%3E%3C/svg%3E%0A");
}

/* CSS to hide the Date of Birth field (already in HTML head for this example, but good to have in CSS file too) */
#dob-group {
    display: none !important;
}
/* Popup Add Expense End */