/* ==========================================================
   Pool Service Dashboard
   layout.css
   Layout / Navigation / Screens / Tables / Modals
========================================================== */

/* ==========================================================
   TOP NAVIGATION
========================================================== */

.top-nav {

    display:flex;

    justify-content:space-between;

    align-items:center;

    background:#1e3a5f;

    color:white;

    padding:15px 25px;

    position:sticky;

    top:0;

    z-index:1000;
}

.nav-btn{

    border:none;

    padding:12px 18px;

    border-radius:6px;

    background:#2d527f;

    color:white;

    cursor:pointer;

    transition:.3s;
}

.nav-links{
    display:flex;
    gap:10px;
}

.nav-btn:hover{
    background:#3f6da6;
}

.nav-btn.active{
    background:#0d6efd;
}

.app-version {

    margin-top: 4px;

    font-size: 12px;

    font-weight: 500;

    letter-spacing: 0.4px;

    color: rgba(255,255,255,0.85);

}

/* ==========================================================
   MAIN CONTENT
========================================================== */

.main {

    padding: 24px;

}

/* ==========================================================
   SCREEN SYSTEM
========================================================== */

.screen {

    display: none;

    background: white;

    border-radius: 10px;

    padding: 24px;

    box-shadow: 0 2px 8px rgba(0,0,0,.08);

}

.screen.active {

    display: block;

}

.page-title{
    color:#1e3a5f;
    margin-bottom:20px;
}


/* ==========================================================
   SCREEN HEADER
========================================================== */

.screen-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.screen-header h2 {
    margin: 0;
    color: #111827;
    font-size: 22px;
    font-weight: 700;
}

.screen-subtitle {

    margin: 4px 0 0 0;
    color: #6b7280;
    font-size: 14px;

}

.screen-header-actions {

    display: flex;

    flex-direction: column;

    gap: 10px;

    width: 100%;

}

/* ==========================================================
   TOOLBAR
========================================================== */

.toolbar {

    margin-bottom: 20px;

}

.toolbar input {

    max-width: 400px;

}

/* ==========================================================
   TABLE
========================================================== */

.table-container {

    width: 100%;

    max-width: 100%;

    overflow-x: auto;

    min-width: 0;

}

.table-container table {

    width: 100%;

    max-width: 100%;

    margin: 0;

}

thead {

    background: #f3f4f6;

}

table{
    width:100%;
    border-collapse:collapse;
}

th{
    background:#0d6efd;
    color:white;
}

th,td{
    padding:12px;
    border:1px solid #ddd;
    text-align:left;
}

tbody tr:hover {

    background: #f8fafc;

}

/* ==========================================================
   ACTION BUTTONS
========================================================== */

td button {

    margin-right: 6px;
    margin-bottom: 4px;

}

/* ==========================================================
   CUSTOMER FORM
========================================================== */

#customerForm {

    margin-top: 24px;

}

#addCustomerBtn {
    background: #0b3d91;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
	margin-bottom: 10px;
}

#addCustomerBtn:hover {
    background: #082c69;
}

/* ==========================================================
   Add Customer
========================================================== */

.customer-form{

    display:none;

    margin-top:2
	0px;

    border-top:1px solid #ddd;

    padding-top:20px;

}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.row input,
.row select {
    flex: 1;
    min-width: 160px;
    padding: 8px;
    box-sizing: border-box;
}

.form-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-buttons{

    margin-top:20px;

    display:flex;

    gap:10px;

    flex-wrap:wrap;

}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.form-actions button {
    width: auto;
}

/*=========================================
    Customer Search Toolbar
=========================================*/

.customer-toolbar {

    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;

    margin-top: 20px;
    margin-bottom: 28px;

}

.search-form {

    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;

}

.search-form label {

    font-weight: 600;

}

.search-controls {

    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;

}

.search-controls input {

    flex: 1 1 auto;
    width: 0;
    min-width: 200px;
    height: 42px;

    margin: 0;
    padding: 0 12px;

    font-size: 16px;

    border: 1px solid #ccc;
    border-radius: 6px;

    box-sizing: border-box;

}

.search-controls .btn-secondary {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: auto;
    min-width: 80px;
    height: 42px;

    margin: 0;
    padding: 0 18px;

    font-size: 15px;
    line-height: 1;

    border: 1px solid #bfc4ca;
    border-radius: 6px;

    background: #f3f4f6;
    color: #333;

    box-sizing: border-box;
    cursor: pointer;

}

.search-controls .btn-secondary:hover {

    background: #e5e7eb;

}

.search-message {

    min-height: 20px;
    font-size: 14px;
    color: #b42318;

}

/*=========================================
  Customer Action Row
=========================================*/
.customer-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.customer-action-row #addCustomerBtn {
  flex: 0 0 auto;
  width: auto;
  min-width: 140px;
}

.customer-data-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.customer-data-controls .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 170px;
  width: 170px;
  height: 42px;
  margin: 0;
  padding: 0 16px;
}

#addCustomerBtn {

    align-self: flex-start;

    width: auto;
    min-width: 180px;
    max-width: 180px;

    margin-top: 4px;

}

@media (max-width: 650px) {

  .customer-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-action-row #addCustomerBtn {
    align-self: flex-start;
  }

  .customer-data-controls {
    justify-content: flex-start;
    margin-left: 0;
  }

}


/*------------------------------------------
    Customer Table Column Widths
------------------------------------------*/
/* Name */
.customer-table th:nth-child(1),
.customer-table td:nth-child(1) {
    min-width: 130px;
}

/* Phone */
.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
    min-width: 110px;
}

/* Address */
.customer-table th:nth-child(3),
.customer-table td:nth-child(3) {
    min-width: 110px;
}

/* Pool Type and Schedule */
.customer-table th:nth-child(4),
.customer-table td:nth-child(4),
.customer-table th:nth-child(5),
.customer-table td:nth-child(5) {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    white-space: nowrap;
}

.customer-table th:nth-child(6),
.customer-table td:nth-child(6) {
    min-width: 120px;
    text-align: center;
    white-space: nowrap;
}

.customer-table td:nth-child(6) button {
    width: max-content;
    min-width: max-content;
    white-space: nowrap;
}

/* ==========================================================
   FORECAST
========================================================== */

.stats {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));

    gap: 15px;

    margin-bottom: 20px;

}

.stat-box {

    background: white;

    padding: 12px 16px;

    border-radius: 10px;

    box-shadow: 0 2px 8px rgba(0,0,0,.1);

    text-align: center;

    min-height: 80px;

    display: flex;

    flex-direction: column;

    justify-content: center;

}

.stat-number {

    font-size: 26px;

    color: #0d6efd;

    font-weight: bold;

    line-height: 1.1;

    margin-bottom: 4px;

}

.risk-section-title {
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 6px;
}

.risk-monitor-title {
    margin-top: 20px;
}

.forecast-date-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forecast-date-field select {
    width: auto;
    min-width: 180px;
    max-width: 220px;
}

/* ==========================================================
   LOCATIONS
========================================================== */

.location-statistics {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(160px, 1fr)
        );

    gap: 16px;

    margin-bottom: 24px;

}

.location-stat-card {

    background: white;

    border: 1px solid #d1d5db;

    border-left: 5px solid var(--primary);

    border-radius: 10px;

    padding: 16px 20px;

    box-shadow: 0 2px 6px rgba(0,0,0,.08);

}

.location-stat-title {

    color: #6b7280;

    font-size: 14px;

    font-weight: 600;

    margin-bottom: 10px;

}

.location-stat-value {

    font-size: 30px;

    font-weight: 700;

    color: var(--primary);

}

.location-stat-card[data-service-day] {
    cursor: pointer;
}

/* ==========================================================
   LOCATION MAP TOOLBAR
========================================================== */

.location-map-toolbar {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 20px;

}

.location-map-toolbar label {

    font-weight: 600;

    white-space: nowrap;

}

.location-map-toolbar select {

    width: auto;

    min-width: 150px;

}

.location-map-toolbar button {

    width: auto;

}

#map {

    width: 100%;

    height: 600px;

    border: 1px solid #d1d5db;

    border-radius: 10px;

    overflow: hidden;

}

/* ==========================================================
   FORECAST TABLE
========================================================== */

#forecastTable {

    width: 100%;

}

/* ==========================================================
   PROPERTY FORECAST TOOLBAR
========================================================== */

.forecast-toolbar {

    display: flex;

    align-items: center;

    gap: 14px;

    margin-top: 16px;

}

.forecast-toolbar label {

    flex: 0 0 auto;

    margin: 0;

    font-weight: 600;

    white-space: nowrap;

}

.forecast-toolbar select {

    flex: 1 1 auto;

    width: auto;

    min-width: 220px;

    max-width: 420px;

    height: 42px;

    margin: 0;

}

.forecast-toolbar button {

    flex: 0 0 auto;

    width: auto;

    height: 42px;

    margin: 0;

}

#forecastPoolConditionsCard h3 {

    margin-bottom: 14px;

}

#forecastRiskBadge {

    margin-bottom: 14px;

}

#forecastRecommendations div {

    margin-bottom: 6px;

}

#forecastRecommendations div:last-child {

    margin-bottom: 0;

}

/* ==========================================================
   CUSTOMER SUMMARY CARD
========================================================== */

#forecastCustomerSummary h3 {

    margin-bottom: 10px;

}

#forecastCustomerSummary p {

    margin-bottom: 4px;

    line-height: 1.5;

}

#forecastCustomerSummary p:last-child {

    margin-bottom: 0;

}

/* ==========================================================
   COMPACT TABLE
========================================================== */

.compact-table {

    table-layout: fixed;

}

/* Customer table only */
.compact-table.customer-table {
    table-layout: auto;
}

.compact-table th,
.compact-table td {

    padding: 7px 10px;

    font-size: 14px;

    line-height: 1.2;

}

.compact-table th {

    white-space: normal;

}

.compact-table tbody tr {

    height: 34px;

}

#sevenDayForecastCard {

    padding-top: 16px;
    padding-bottom: 16px;

}

#sevenDayForecastCard h3 {

    margin-bottom: 8px;

}

#betweenVisitForecastCard h3 {

    margin-bottom: 14px;

}

/* ==========================================================
   REGIONAL FORECAST
========================================================== */

#regionalForecastCard .stats {

    gap: 12px;

    margin-bottom: 0;

}

#regionalForecastCard .stat-box {

    padding: 12px;

    min-height: 72px;

}

#regionalForecastCard .stat-number {

    font-size: 24px;

    margin-bottom: 4px;

}

/* ==========================================================
   ROUTES
========================================================== */

.route-card {

    background: white;

    border: 1px solid #d1d5db;

    border-left: 5px solid #0b3d91;

    border-radius: 8px;

    padding: 16px;

    margin-bottom: 12px;

    box-shadow: 0 2px 6px rgba(0,0,0,.05);

}

#routeTitle {

    margin-bottom: 18px;

}

.route-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.route-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.route-toolbar label {
    font-weight: 600;
    white-space: nowrap;
}

.route-toolbar select {
    width: auto;
    min-width: 160px;
}

.route-toolbar button {
    width: auto;
}

/*=========================================
    Route Risk
=========================================*/

.risk-reason {

    display: inline-block;

    margin-top: 4px;

    font-size: 13px;

    color: #6b7280;

}

/*=========================================
    Route Risk Badge
=========================================*/

.risk-badge {

    display: inline-block;

    padding: 3px 10px;

    border-radius: 999px;

    font-size: 13px;

    font-weight: 700;

}

.risk-reason {

    display: block;

    margin-top: 5px;

    font-size: 13px;

    color: #6b7280;

    white-space: normal;

}
.risk-low {

    background: #dcfce7;

    color: #166534;

}

.risk-moderate {

    background: #fef3c7;

    color: #92400e;

}

.risk-high {

    background: #fee2e2;

    color: #991b1b;

}

.risk-recommendations {

    margin-top: 5px;

}

.risk-recommendation {

    font-size: 13px;

    color: #6b7280;

    line-height: 1.5;

}

/*=========================================
    Route Statistics
=========================================*/

.route-statistics {

    display: flex;

    gap: 20px;

    margin-top: 10px;
    margin-bottom: 24px;

}

.route-stat-card {

    flex: 1;

    background: white;

    border: 1px solid #d1d5db;

    border-left: 5px solid var(--primary);

    border-radius: 10px;

    padding: 16px 20px;

    box-shadow: 0 2px 6px rgba(0,0,0,.08);

}

.route-stat-title {

    color: #6b7280;

    font-size: 14px;

    font-weight: 600;

    margin-bottom: 10px;

}

.route-stat-value {

    font-size: 32px;

    font-weight: 700;

    color: var(--primary);

}

/*=========================================
    Route Actions
=========================================*/

.route-actions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.route-actions-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.route-actions-toolbar button {
    width: auto;
    min-width: 170px;
}

.actions-column {

    text-align: center;

}

.actions-column button {

    margin: 2px 4px;

}

/*=========================================
    Route Table
=========================================*/
.route-table {
    width: 100%;
    table-layout: fixed;
}

.route-number-col {
    width: 52px;
}

.route-customer-col {
    width: 19%;
}

.route-address-col {
    width: 21%;
}

.route-weather-col {
    width: 18%;
}

.route-risk-col {
    width: 27%;
}

.route-actions-col {
    width: 150px;
}

.route-table th,
.route-table td {
    vertical-align: top;
    font-size: 14px;
    line-height: 1.4;
}

.route-table th:nth-child(1),
.route-table td:nth-child(1) {
    text-align: center;
}

.route-table td:nth-child(2),
.route-table td:nth-child(3),
.route-table td:nth-child(4),
.route-table td:nth-child(5) {
    white-space: normal;
    overflow-wrap: anywhere;
}

.route-weather-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 14px;
    line-height: 1.4;
}

.route-weather-condition {
    font-weight: 600;
    color: var(--text);
}

.route-actions-column {
    text-align: center;
    vertical-align: middle !important;
}

.route-action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.route-action-buttons button {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 10px 14px;
    white-space: nowrap;
}

/*=========================================
    Optimize Route Dialog
=========================================*/

.modal.optimize-route-modal {
    box-sizing: border-box;
    width: 640px;
    max-width: calc(100vw - 48px);
}

.optimize-route-form {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.optimize-route-field:nth-child(3) {
    grid-column: 1 / 3;
}

.optimize-route-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.optimize-route-field label {
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
}

.optimize-route-modal h2 {
    margin-bottom: 24px;
}

.optimize-route-field > div,
.optimize-route-field input {
    box-sizing: border-box;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text);
}

.optimize-route-field:nth-child(3) > div {
    width: fit-content;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.optimize-route-message {
    margin-bottom: 14px;
}

.optimize-route-results {
    margin-top: 18px;
}

.optimize-route-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

#optimizeRouteMessage {
    white-space: pre-line;
}

.optimized-route-list {
    margin: 16px 0;
}

.optimized-route-stop {
    margin-bottom: 12px;
}

.optimized-route-stop:last-child {
    margin-bottom: 30px;
}


/* ==========================================================
   DASHBOARD CARDS
========================================================== */

.grid {

    display: grid;

    gap: 20px;

}

.grid-2 {

    grid-template-columns: repeat(2,1fr);

}

.grid-3 {

    grid-template-columns: repeat(3,1fr);

}

/* ==========================================================
   MODAL
========================================================== */

/* .modal-overlay {

    position: fixed;

    inset: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    background: rgba(0,0,0,.45);

    z-index: 9999;

} */

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 24px 0;
    background: rgba(0,0,0,.45);
    z-index: 9999;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal {

    width: 360px;

    max-width: 95%;

    background: white;

    border-radius: 10px;

    padding: 20px;

    box-shadow: 0 20px 40px rgba(0,0,0,.25);

}

.modal h3 {

    margin-bottom: 10px;

}

.modal p {

    margin-bottom: 20px;

    color: #374151;

}

.modal-actions {

    display: flex;

    justify-content: flex-end;

    gap: 10px;

}

/*=========================================
    Service History
=========================================*/
.history-filter-card {
    margin-bottom: 24px;
}

.history-filter-card h3 {
    margin-bottom: 18px;
}

.history-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.history-filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-filter-field label {
    font-weight: 600;
}

.history-filter-field input,
.history-filter-field select {
    width: 100%;
    min-height: 42px;
}

.history-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.history-filter-actions button {
    flex: 0 0 auto;
    min-height: 42px;
}

/*=========================================
    Service History Statistics
=========================================*/

.history-statistics {
    display: flex;
    gap: 20px;
    margin: 24px 0;
}

.history-stat-card {
    flex: 1;
    background: white;
    border: 1px solid #d1d5db;
    border-left: 5px solid var(--primary);
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.history-stat-title {
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.history-stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary);
}

.history-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.history-results-header h3 {
    margin: 0;
}

#historyResultMessage {
    color: var(--muted);
    font-size: 14px;
    text-align: right;
}

/*=========================================
    Service History Filters
=========================================*/

.history-filter-card {
    padding: 14px;
    margin-bottom: 14px;
}

.history-filter-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.history-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.history-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-filter-field label {
    font-size: 13px;
}

.history-filter-field input,
.history-filter-field select {
    min-height: 36px;
}

.history-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.history-filter-actions button {
    min-height: 36px;
}

/*=========================================
    Service History Table
=========================================*/

.history-table {
    width: 100%;
    table-layout: fixed;
}

.history-date-col {
    width: 135px;
}

.history-customer-col {
    width: 180px;
}

.history-service-col {
    width: auto;
}

.history-status-col {
    width: 110px;
}

.history-actions-col {
    width: 150px;
}

.history-action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.history-action-buttons button {
    width: 110px;
    min-width: 110px;
    margin: 0;
}

/*=========================================
    Service Visit Dialog
=========================================*/
/* .modal.service-visit-modal {
    box-sizing: border-box;
    width: 74vw;
    height: 94vh;
    overflow-y: auto;
    padding-left: 0;
    padding-right: 0;
}

#serviceVisitOverlay {
    width: 74vw;
    padding: 0;
    border: none;
    margin: auto;
} */

/* .modal.service-visit-modal {
    box-sizing: border-box;
    width: 74vw;
    height: 94vh;
    overflow-y: auto;
} */

#serviceVisitOverlay {
    box-sizing: border-box;
    width: 760px;
    max-width: calc(100vw - 48px);
    height: 94vh;
    padding: 0;
    border: none;
    margin: auto;
    overflow-y: auto;
}

.modal.service-visit-modal {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: auto;
    overflow: visible;
}

.service-visit-modal h2 {
    margin-bottom: 16px;
}

.service-visit-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Customer | Service Date | Address */
.service-visit-summary-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 2.0fr;
    gap: 14px;
}

/* Status | Service Event | Technician */
.service-visit-edit-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 2.0fr;
    gap: 14px;
    width: 100%;
}

/* Service | Chemicals Used */
.service-visit-work-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.service-visit-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.service-visit-field label {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.service-visit-field > div {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.service-visit-editable {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.service-visit-field input,
.service-visit-field select,
.service-visit-field textarea {
    width: 100%;
}

.service-visit-field textarea {
    min-height: 100px;
    resize: vertical;
}

.notes-panel {
    display: flex;
    flex-direction: column;
}

.notes-panel textarea {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* Matching outer Service and Chemicals panels */
.service-panel,
.chemical-panel {
    box-sizing: border-box;
    min-width: 0;
    min-height: 245px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.service-panel,
.chemical-panel {
    min-height: 275px;
}

/* Matching inner Service and Chemicals boxes */
.service-recommendation-list,
.service-chemical-list {
    box-sizing: border-box;
    width: 100%;
    min-height: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
}

.notes-panel {
    width: 100%;
}

.service-visit-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/*=========================================
    Filter Information
=========================================*/
.filter-info-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-info-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.filter-info-row span {
    color: var(--muted);
    font-size: 13px;
}

.filter-info-row strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

/*=========================================
    Service Visit Chemicals
=========================================*/
.service-chemical-list {
    display: grid;
    grid-template-columns: 291px 291px;
    justify-content: space-between;
}

.service-chemical-header {
    display: grid;
    grid-template-columns: 165px 54px 44px;
    column-gap: 14px;
    padding-bottom: 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.service-chemical-row {
    display: grid;
     grid-template-columns: 165px 54px 44px;
    column-gap: 14px;
    margin-bottom: 4px;
    align-items: center;
}

.service-chemical-row label {
    color: var(--text);
    font-size: 12px;
}

.service-chemical-row input {
    box-sizing: border-box;
    width: 100%;
    height: 28px;
    min-height: 28px;
    padding: 3px 5px;
    font-size: 12px;
}

.service-chemical-row span {
    font-size: 12px;
    white-space: nowrap;
}

.service-visit-work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;
}

.service-visit-work-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.service-panel {
    height: auto;
    min-height: 0;
    box-sizing: border-box;
}

.service-task-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-task-row input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.service-task-row span {
    display: inline;
}

/* .service-visit-summary-grid,
.service-visit-edit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
} */

#editVisitTechnician {
    width: 100%;
    box-sizing: border-box;
}

.service-task-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 16px;
    padding-top: 8px;
}

.service-task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 22px;
}

.service-task-row input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.service-task-row span {
    line-height: 1.4;
}

/* ==========================================================
   TOAST
========================================================== */

.toast {

    position: fixed;

    bottom: 20px;

    right: 20px;

    background: #111827;

    color: white;

    padding: 12px 18px;

    border-radius: 8px;

    box-shadow: 0 4px 12px rgba(0,0,0,.20);

    z-index: 10000;

}

/* ==========================================================
   UTILITIES
========================================================== */

.text-right {

    text-align: right;

}

.text-center {

    text-align: center;

}

.w-100 {

    width: 100%;

}