body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f2f4fb;
    display: flex;
    flex-direction: column;
}

#metrics-container {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #00457e;
    display: flex; 
    gap: 16px;
    padding-top: 10px;
    height: 120px;
    width: 100%; 
    border-radius: 20px; 
}

#total-spent-container {
    display: flex;
    width: 100%;
    padding: 5px;
    background-color: #dcdee9;
    border-radius: 16px;
}

#budget-spent-container {
    width: 100%;
    display: flex;
    gap: 16px;
    padding: 2.5px 0 2.5px 0;
    border-radius: 16px;
}

#total-spent-container-header {
    width: 22%;
    padding: 5px;
}

#planned-budget-container {
    width: 22.5%;
    padding: 15px 10px 10px 15px;
    background-color: #ffbd01;
    border-radius: 16px;   
}

#planned-budget-container h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 7.5px;
    margin-bottom: 15px;
}

#planned-budget-container p {
    margin-top: 10px;
    font-size: 24px;
    font-weight: 650;
}

#total-spent-container-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 7.5px;
    margin-bottom: 15px;
}

#total-spent-container-header p {
    margin-top: 10px;
    font-size: 25px;
    font-weight: 650;
}

#state-budget-spent,
#local-budget-spent,
#partners-budget-spent {
    display: flex;
    flex-direction: column;
    padding: 5px;
    border-radius: 16px;
    background-color: white;
    /* width: 100%; */
    flex: 1 1 0; 
}

#local-budget-spent {
    flex: 0.92 1 0;
}

#partners-budget-spent {
    flex: 0.7 1 0; 
}

#state-budget-spent h3,
#state-budget-spent p,
#local-budget-spent h3,
#local-budget-spent p,
#partners-budget-spent h3,
#partners-budget-spent p {
    margin-left: 5px;
    margin-bottom: 0px;
}

#state-budget-spent h3,
#local-budget-spent h3,
#partners-budget-spent h3 {
    font-size: 20px;
    padding-top: 5px;
    margin-top: 0px;
    font-weight: 600;
}

#state-budget-spent p,
#local-budget-spent p,
#partners-budget-spent p {
    margin-top: 15px;
    font-weight: 600;
    font-size: 24px;
}

.metrics-value,
#total-spent-container-header p,
#planned-budget-container p,
#state-budget-spent p,
#local-budget-spent p,
#partners-budget-spent p {
  white-space: nowrap;
}

#metrics-container, 
#total-spent-container, 
#budget-spent-container {
  flex-wrap: nowrap;
  min-width: 0;
}

#total-spent-container-header,
#planned-budget-container,
#state-budget-spent,
#local-budget-spent,
#partners-budget-spent {
  min-width: 0;
}

#metrics-container {
  overflow-x: auto;
}

#total-spent-container-header p,
#planned-budget-container p,
#state-budget-spent p,
#local-budget-spent p,
#partners-budget-spent p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#main-content {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    width: 100%;
    gap: 20px;
    box-sizing: border-box;
}

#map-sidebar-container {
  display: flex;
  /*align-items: flex-start;*/
  gap: 20px;
  background: transparent;
  padding: 0;
  border-radius: 0;
  position: relative;
}

.map-home-btn {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 10;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #ffffff;
  color: #00467E;
  border: 1px solid #dcdee9;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.map-home-btn:hover {
  background: #00467E;
  color: #ffffff;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 250px;
  padding: 13px 13px 13px 13px;

  background: #ffffff;
  border: 1px solid #dcdee9;
  border-radius: 20px;
  
  overflow-y: visible;
  max-height: none;
  box-sizing: border-box;
}

#treemap-sidebar-container,
#bar-charts-sidebar-container,
#tables-sidebar-container {
    display: flex;
    border-radius: 20px;
    flex-direction: row;
    column-gap: 20px;
    background-color: white;
}

#map-container,
#treemap-container,
#line-chart-container,
#bar-payer,
#bar-reciept,
#tables-container {
    flex: 1;
    padding: 20px;
    border-radius: 20px;
}

#map-container {
  flex: 1;
  min-height: 700px;
  align-self: stretch;

  padding: 20px;
  background: #ffffff;
  border: 1px solid #dcdee9;
  border-radius: 20px;
  box-sizing: border-box;
}

#treemap-container,
#line-chart-container,
#bar-payer,
#bar-reciept {
    height: 500px;
}

#programs-table,
#objects-table {
    width: 100%;
}

#objects-table {
    margin-top: 20px;
}

#tables-container {
    width: calc(100% - 40px);
    padding: 0 20px;
    border-radius: 20px;
}

.row {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #00457e;
}

.sidebar h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 20px;
}

.form-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #dcdee9;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    background-color: #ffffff;
    transition: border-color 0.3s, box-shadow 0.3s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select2-container--default .select2-selection--single {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #dcdee9;
    background-color: #ffffff;
}

.form-select:focus {
    border-color: #00457e;
    box-shadow: 0 0 5px rgba(0, 69, 126, 0.3);
    outline: none;
}

button[data-reset-target] {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
    background-color: #00457e;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

button[data-reset-target]:hover {
    background-color: #003366;
    box-shadow: 0 0 5px rgba(0, 51, 102, 0.3);
}

button[data-reset-target]:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 69, 126, 0.3);
}

#reset-all-filters {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    margin-top: 15px;
    width: 100%;
    color: #003366;
    background-color: #ffbd01;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

#container {
    padding-top: 1.5rem;
}

#tables-container h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

#programs-table, #objects-table {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #dcdee9;
    margin-bottom: 20px;
}

#programs-table th, 
#programs-table td,
#objects-table th, 
#objects-table td {
    border: 1px solid #dcdee9;
    padding: 8px;
}

#programs-table thead th:first-child,
#objects-table thead th:first-child {
    border-top-left-radius: 10px;
    background-color: #f3f4fa;
}

#programs-table thead th:last-child,
#objects-table thead th:last-child {
    border-top-right-radius: 10px;
}

#programs-table tbody tr:last-child td:first-child,
#objects-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}

#programs-table tbody tr:last-child td:last-child,
#objects-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

#objects-table td:first-child, 
#objects-table th:first-child {
    min-width: 120px;
    max-width: 250px;
    word-break: break-word;
    white-space: normal;
}

th[data-key="t-program"] {
    width: 60%;
}

@media (max-width: 767px) {
    .sidebar {
        display: none;
    }
    #main-content {
        width: 100%;
    }
}

/* ##--##--## TOOLTIP ##--##--## */

.map-point-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.map-point-modal.hidden {
    display: none;
}

.map-point-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.map-point-modal__dialog {
    position: fixed;
    top: var(--map-point-modal-center-y, 50vh);
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: min(1200px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    overflow: hidden;
}

.map-point-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #00457e;
    color: #fff;
    font-size: 22px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    z-index: 3;
}

.map-point-modal__close:hover {
    background: #003366;
}

.map-point-modal__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    padding-top: 64px;
    box-sizing: border-box;
}

.map-point-modal__content {
    color: #1f2937;
}

.map-point-popup-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.map-point-popup-section {
    min-width: 0;
}

.map-point-popup-section table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.map-point-popup-section th,
.map-point-popup-section td {
    border: 1px solid #dcdee9;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    word-break: break-word;
}

.map-point-popup-section th {
    background: #f3f4fa;
    color: #00457e;
    font-weight: 700;
}

.map-point-popup-meta th {
    width: 220px;
    white-space: nowrap;
}

.map-point-popup-payments {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
}

.map-point-popup-payments table {
    min-width: 900px;
}

.map-point-popup-note {
    font-size: 14px;
    color: #555;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .map-point-modal {
        padding: 10px;
    }

    .map-point-modal__dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 14px;
    }

    .map-point-modal__scroll {
        padding: 16px;
        padding-top: 60px;
    }

    .map-point-popup-meta th {
        width: 140px;
        white-space: normal;
    }

    .map-point-popup-section th,
    .map-point-popup-section td {
        font-size: 13px;
        padding: 8px;
    }

    .map-point-popup-payments table {
        min-width: 700px;
    }
}

.map-point-popup-header {
    font-size: 22px;
    font-weight: 700;
    color: #00457e;
    line-height: 1.3;
    margin-bottom: 4px;
}

.map-point-popup-amount-col {
    white-space: nowrap;
    width: 1%;
    min-width: 120px;
}

.map-point-popup-payments th.map-point-popup-amount-col {
    white-space: nowrap;
    text-align: left;
}

.map-point-popup-payments td.map-point-popup-amount-col {
    white-space: nowrap;
    text-align: right;
}

.map-point-popup-amount-col {
    white-space: nowrap;
    width: 1%;
    min-width: 120px;
}

.map-point-popup-payments th.map-point-popup-amount-col {
    white-space: nowrap;
    text-align: center;
}

.map-point-popup-payments td.map-point-popup-amount-col {
    white-space: nowrap;
    text-align: right;
}

.map-point-popup-procurement-col {
    white-space: nowrap;
    width: 1%;
    min-width: 180px;
}

.map-point-popup-payments th.map-point-popup-procurement-col,
.map-point-popup-payments td.map-point-popup-procurement-col {
    white-space: nowrap;
}

.map-point-popup-section th,
.map-point-popup-section td {
    border: 1px solid #dcdee9;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    word-break: break-word;
}

.map-point-popup-payments th {
    text-align: center;
}