/* ===================== Limited Water Page Layout ===================== */
.limited-water-page-container{
    height: 95vh; 
    width: 97.5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content:flex-start;
    padding: 1px;
    box-sizing: border-box;
    overflow-y: auto;
}

.limited-water-page-header{
    height: 6.5vh;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content:space-between;
    background-color: var(--div-head-first-background-color);
    color: var(--text-color);
    font-style: var(--font-style);
    font-weight: var(--font-width);
    padding-bottom: 1px;
    border: var(--div-border);
    border-top-left-radius: 5px;  
    border-top-right-radius: 5px;
    box-sizing: border-box;
}

.limited-water-page-header-input-container{
    width: auto;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
    gap: 5px;
    font-size: 110%;
    color: var(--text-color);
    font-weight: bold;
    box-sizing: border-box;
}

.limited-water-page-header-total-area-container{
    width: auto;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 2px;
    gap: 20px;
    font-size: 130%;
    color: var(--text-color);
    font-weight: bold;
    box-sizing: border-box;
}

.limited-water-page-header-title{
    width: auto;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    padding: 2px;
    gap: 2px; 
    font-size: auto;
    color: var(--text-color);
    font-weight: bold;
    box-sizing: border-box;
    border: var(--div-border);
    border-radius: 5px;  
}

/* ===================== Table & Column Widths ===================== */
.limited-water-table col.col-plot-day        { width: 17rem; }
.limited-water-table col.col-phen-stage      { width: 16rem; }  /* widen if needed */
.limited-water-table col.col-expected-yield  { width: 7rem; }
.limited-water-table col.col-day             { width: 12rem; }  /* each day column */
.limited-water-table col.col-plus-all        { width: 3rem; }
.limited-water-table col.col-minus-all       { width: 3rem; }

/* Full table container */
.limited-water-table-body{
    width: 100%;
    height: auto;
    box-sizing: border-box;
}

/* Table */
.limited-water-table{
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    background-color: #fff;
    text-align: left;
    box-sizing: border-box;
    table-layout: fixed;           /* lock column widths */
}

/* Base cells */
.limited-water-table th,
.limited-water-table td{
    overflow: hidden;              /* default clipping (overridden for dropdown cells) */
    vertical-align: middle;
    text-overflow: ellipsis;
    position: relative;            /* baseline stacking context */
    z-index: 0;
}

/* Header row */
.limited-water-table .header-cell{
    background-color: #bdbbbb;
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #ccc;
}

/* headers for past days */
.limited-water-table .header-cell.past-day {
    color: rgb(22, 5, 250);
    font-weight: bold;
}

/* Row labels like 'Recommended' and 'Planned' */
.limited-water-table .row-label{
    background-color: #f9f9f9;
    font-weight: bold;
    padding: 0.5rem;
    border: 1px solid #ccc;
}

/* General cell styling */
.limited-water-table td{
    padding: 0.3rem;
    border: 1px solid #ddd;
    vertical-align: middle;
    text-align: center;
}

/* Fixed-size day columns (helpers) */
.limited-water-table .day-col,
.limited-water-table .day-cell{
    width: 12rem;   /* keep in sync with col.col-day if you use it */
}
.limited-water-table .day-cell{
    height: 44px;
    padding: 0.25rem;
}

/* ===================== Dropdown Cells (Dash dcc.Dropdown v3) ===================== */
/* Host TD: allow menu to escape and stack above neighbors */
.limited-water-table .dropdown-cell{
    position: relative;
    overflow: visible !important;  /* override base td overflow */
    z-index: 1;
    min-width: 280px;              /* baseline width for the control */
}

/* Control fills the cell */
.limited-water-table .dropdown-cell .Select{
    width: 100%;
}

/* When open, lift the control above other rows */
.limited-water-table .dropdown-cell .Select.is-open{
    position: relative;
    z-index: 30000;
}

/* Menu container (react-select v1; here it is portaled to <body>) */
.Select-menu-outer{
    z-index: 200000;               /* ensure portaled menus float above app */
}

/* If for some reason the menu is still inside the cell, keep these too */
.limited-water-table .dropdown-cell .Select-menu-outer{
    position: absolute;
    left: 0;
    z-index: 40000;       
    width: max-content;
    min-width: 100%;
    max-width: 80vw;
    white-space: nowrap;
    box-sizing: border-box;

    max-height: 120px !important;
    overflow-y: auto !important;
}

/* Inner menu follows outer width when not portaled */
.limited-water-table .dropdown-cell .Select-menu{
    width: 100%;
}

/* Options: single line (virtualized & non-virtualized) */
.limited-water-table .dropdown-cell .Select-option,
.limited-water-table .dropdown-cell .VirtualizedSelectOption,
.limited-water-table .dropdown-cell .VirtualizedSelectFocusedOption{
    white-space: nowrap;
}

/* Scope for phenological stage if you want extra control */
.limited-water-table .phenological-stage-cell .Select{ width: 100%; }

/* ===================== Weather Widget Cell ===================== */
.limited-water-table .weather-widget-cell{ padding: 0; }
.limited-water-table .weather-widget-cell > div{
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin; /* Firefox */
}
.weather-pill{ line-height: 1.1; }

/* ===================== Graphs / Misc ===================== */
.limited-water-graphs-body{
    width: 100%;
    height: auto;
    box-sizing: border-box;
}
/* .get_limited_water_graphs{
    width: 100%;    
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: auto;
} */

.limited-water-gauge-graphs{
    width: 100%;    
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0px;
    margin: 0.5px;
    box-sizing: border-box;
    /* overflow-y: auto;
    overflow-x: auto; */
}

#limited-water-date-picker input{ padding: 0px; }

/* ===================== Floating Divs / Messages ===================== */
.limited-water-floating-div-show{
    display: block;
    position: fixed;
    top: 40%;
    left: 20%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    min-height: 10vh;
    min-width: 15vw;
    max-width: 35vw;
    max-height: 80vh;
    background: var(--div-body-background-color);
    border: var(--div-border);
    border-radius: 5px;
    box-shadow: var(--floating-selected-box-shadow);
    z-index: 1000;
    text-align: center;
    box-sizing: border-box;
}

.limited-water-new-program-name-input-div{
    width: 100%;
    height: 4.5vh;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    padding: 2px;
    gap: 2px; 
    font-size: auto;
    color: var(--text-color);
    font-weight: bold;
    box-sizing: border-box;
    border-bottom: var(--div-border);
}

.no-programs-available{
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    font-size: 200%;
    color: var(--text-color);
    font-weight: bold;
    box-sizing: border-box;
}

/* ===================== Buttons / Helpers ===================== */
.btn-plus,
.btn-minus{
    font-weight: bold;
    font-size: 150%;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: auto;
}
.btn-plus{ color: rgb(10, 110, 6); }
.btn-minus{ color: rgb(223, 16, 16); }

.centered-cell{
    text-align: center;
    vertical-align: middle;
}

/* ===================== Weather widget fallback (older rules) ===================== */
.weather-widget-cell{
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}
.weather-widget-cell > div{
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Popup: shrink-wrap content, but cap overall height */
.limited-water-duplicated-allocations-floating-div-show{
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48vw; max-width: 90vw;
  height: auto;                /* ⬅️ was a fixed vh; now auto */
  max-height: 80vh;            /* ⬅️ prevents runaway growth */
  background: var(--div-body-background-color);
  border: var(--div-border); border-radius: 6px;
  box-shadow: var(--floating-selected-box-shadow);
  z-index: 1000; box-sizing: border-box;
  display: flex; flex-direction: column;
  overflow: visible;            /* table has its own internal scroll */
}

.floating-div-head-first-div{ flex: 0 0 auto; }

/* Report container: do NOT fill leftover space */
.limited-water-duplicated-allocations-report-div{
  flex: 0 0 auto;              /* ⬅️ was flex:1; stop stretching */
  height: auto;                /* just fit the table */
  padding: 6px;
  overflow: visible;           /* table handles its own scrolling */
}

.limited-water-duplicated-allocations-table-container{
  width: 100%;
  /* no height needed — DataTable's style_table[maxHeight] makes it scroll */
}
