/* =========================
   POOLS MODULE
========================== */

.pools-page {
  padding: 16px;
}

.pools-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pools-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pools-title {
  font-size: 20px;
  font-weight: 600;
}

.pools-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.pools-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  transition: 0.2s ease;
}

.pools-card {
  position: relative;
  cursor: pointer;
}

.pools-card-link {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 1;
}

.pools-card-right {
  position: relative;
  z-index: 2;
}

.pools-card-left {
  position: relative;
  z-index: 2;
}

.pools-card:hover {
  border-color: #2563eb;
}

.pools-card-disabled {
  opacity: 0.6;
}

.pools-card-title {
  font-weight: 600;
  font-size: 15px;
}

.pools-card-sub {
  font-size: 12px;
  color: #6b7280;
}

.pools-empty {
  padding: 30px;
  text-align: center;
  color: #6b7280;
}

/* =========================
   SWITCH (iPhone Style)
========================== */

.pools-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.pools-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pools-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e7eb;
  transition: 0.3s;
  border-radius: 22px;
}

.pools-switch-slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.pools-switch input:checked + .pools-switch-slider {
  background-color: #2563eb;
}

.pools-switch input:checked + .pools-switch-slider:before {
  transform: translateX(20px);
}

/* =========================
   FORM
========================== */

.pools-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pools-card-section {
  border: 1px solid #e5e7eb;
  padding: 16px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pools-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pools-form-row input,
.pools-form-row select {
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

.pools-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pools-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pools-volume-result {
  font-size: 14px;
  color: #2563eb;
}

/* =====================================================
   POOLS MODULE
   Todas las clases inician con pool-
===================================================== */

/* =====================================================
   WRAPPERS GENERALES
===================================================== */

.pool-wrapper,
.pool-calculator-wrapper,
.pool-photos-wrapper,
.pool-equipment-wrapper {
  padding: 16px;
}

/* =====================================================
   HEADERS
===================================================== */

.pool-header,
.pool-calculator-header,
.pool-photos-header,
.pool-equipment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pool-header h2,
.pool-calculator-header h2,
.pool-photos-header h2,
.pool-equipment-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

/* =====================================================
   INPUTS
===================================================== */

.pool-input,
.pool-select,
.pool-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 10px;
  background: #fff;
}

.pool-input:focus,
.pool-select:focus,
.pool-textarea:focus {
  outline: none;
  border-color: #2563eb;
}

/* =====================================================
   CARDS
===================================================== */

.pool-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column; /* 🔥 CAMBIO CLAVE */
  width: 100%;
  box-sizing: border-box;
}

.pool-card-title {
  font-weight: 600;
  font-size: 14px;
}

.pool-card-sub {
  font-size: 12px;
  color: #6b7280;
}

/* =====================================================
   PHOTOS GRID
===================================================== */

.pool-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.pool-photo-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  text-align: center;
}

.pool-photo-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

/* =====================================================
   EQUIPMENT LIST
===================================================== */

.pool-equipment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pool-equipment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
}

/* =====================================================
   CALCULATOR
===================================================== */

.pool-calculator-body {
  max-width: 500px;
}

.pool-calculator-actions {
  margin-top: 10px;
  margin-bottom: 14px;
}

.pool-calculator-result {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
}

/* =====================================================
   SWITCH IPHONE STYLE
===================================================== */

.pool-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.pool-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pool-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  transition: 0.3s;
  border-radius: 22px;
}

.pool-switch-slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.pool-switch input:checked + .pool-switch-slider {
  background-color: #22c55e;
}

.pool-switch input:checked + .pool-switch-slider:before {
  transform: translateX(20px);
}

/* =====================================================
   STATUS BADGE
===================================================== */

.pool-status-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 500;
}

.pool-status-badge.active {
  background: #dcfce7;
  color: #166534;
}

.pool-status-badge.inactive {
  background: #fee2e2;
  color: #991b1b;
}

/* =====================================================
   EMPTY STATES
===================================================== */

.pool-empty {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: #6b7280;
}

/* =========================
   SIMPLE POOL FORM
========================== */

.pool-simple-wrapper {
  padding: 16px;
}

.pool-simple-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pool-simple-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pool-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pool-field input,
.pool-field textarea {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

.pool-gallons-row {
  display: flex;
  flex-direction: column;
}

.pool-gallons-input {
  display: flex;
}

.pool-gallons-input input {
  flex: 1;
}

.pool-gallons-input button {
  width: 44px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
}

#shapeDiagram {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

/* =========================================
   SHAPE SELECT
========================================= */

.pools-shape-select-row {
  display: flex;
  gap: 8px;
}

/* =========================================
   DIAGRAM
========================================= */

.pools-diagram-wrapper {
  text-align: center;
}

#shapeDiagram {
  max-width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

/* =========================================
   PARAMETERS WITH SLIDER
========================================= */

.pools-parameter-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.pools-parameter-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pools-parameter-control input[type='number'] {
  width: 80px;
}

.pools-unit {
  font-size: 13px;
  color: #6b7280;
}

.pools-slider {
  flex: 1;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: #e5e7eb;
  outline: none;
}

.pools-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
}

.pools-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
}

/* =========================================
   PRESSURE SLIDER
========================================= */

.pool-pressure-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pool-pressure-control input[type='number'] {
  width: 80px;
}

.pool-unit {
  font-size: 13px;
  color: #6b7280;
}

.pool-slider {
  flex: 1;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: #e5e7eb;
  outline: none;
}

.pool-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
}

.pool-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
}

.pool-pressure-info {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
}

.pool-card-content {
  flex: 1;
  padding-right: 12px; /* 🔥 evita que el switch se monte */
}

.pool-subsections {
  width: 100%;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pool-subcard {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.pool-subcard:hover {
  border-color: #2563eb;
  background: #ffffff;
}

.pool-card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* 🔥 importante */
  width: 100%;
}

.pool-equipment-row-disabled {
  opacity: 0.5;
  background: #f3f4f6;
}

.pool-equipment-row-disabled .pool-card-title,
.pool-equipment-row-disabled .pool-card-sub {
  color: #9ca3af;
}

.pool-subsection-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  background: #f9fafb;
  cursor: pointer;
  transition: 0.2s ease;
}

.pool-subsection-card:hover {
  border-color: #2563eb;
  background: #ffffff;
}

.pool-item-row {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.pool-item-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.badge-chemical {
  background: #e6f7ec;
  color: #1e7d34;
}
.badge-part {
  background: #fff3e0;
  color: #b26a00;
}
.badge-product {
  background: #e3f2fd;
  color: #0d47a1;
}
.badge-other {
  background: #f5f5f5;
  color: #555;
}

.pool-item-name {
  font-weight: 500;
}

.pool-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pool-items-actions {
  display: flex;
  gap: 8px;
}

.pool-items-header {
  cursor: pointer;
}

.pool-items-actions button {
  cursor: pointer;
}

.pool-type-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.pool-type-option {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.pool-type-option:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.pool-type-option i {
  font-size: 16px;
  color: #2563eb;
}

/* =======================================
   POOLS SELECT PRODUCT – FIXED LAYOUT
======================================= */

.pools-select-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}

/* ROW 1 */
.pools-select-row1 {
  display: grid;
  grid-template-columns: 170px 90px 60px; /* FIJO */
  align-items: center;
}

/* ROW 2 */
.pools-select-row2 {
  display: grid;
  grid-template-columns: 240px 60px; /* mismo ancho total que row1 */
  align-items: center;
  margin-top: 8px;
}

/* NAME */
.pools-select-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* QTY */
.pools-select-qty {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

/* PRICE */
.pools-select-price {
  text-align: right;
  font-weight: 600;
}

/* DESCRIPTION */
.pools-select-description {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ACTION */
.pools-select-action {
  display: flex;
  justify-content: flex-end;
}

/* =====================================
   SEARCH BAR STYLE
===================================== */

.pools-select-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.pools-select-search i {
  color: #9ca3af;
  font-size: 14px;
}

.pools-select-search input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  background: transparent;
}

/* =====================================
   ITEMS NEEDED – FIXED ROW LAYOUT
===================================== */

.pool-items-row-fixed {
  display: grid;
  grid-template-columns: 90px 1fr 80px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid #f1f1f1;
}

/* Category */
.pool-items-col-category {
  font-size: 12px;
  font-weight: 600;
}

/* Name */
.pool-items-col-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quantity */
.pool-items-col-qty {
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

/* =========================================
   SERVICE CHECKLIST
========================================= */

.pool-checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pool-checklist-header {
  cursor: pointer;
}

.pool-checklist-actions {
  display: flex;
  gap: 8px;
}

.pool-checklist-body {
  margin-top: 10px;
}

.pools-checklist-service {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.pools-checklist-service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.pools-checklist-service-header:hover {
  background: #f9fafb;
}

.pools-checklist-service-title {
  font-weight: 600;
}

.pools-checklist-service-meta {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pools-checklist-items {
  padding: 8px 12px 12px 12px;
  border-top: 1px solid #f1f1f1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pools-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* =========================================
   CHECKLIST SELECTOR
========================================= */

.pools-checklist-selector {
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.pools-checklist-selector-row {
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f1f1f1;
}

.pools-checklist-selector-row:last-child {
  border-bottom: none;
}

.pools-checklist-selector-row:hover {
  background: #f9fafb;
}

/* =========================================
   CHECKLIST ITEM ROW ALIGNMENT
========================================= */

.pools-checklist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
}

.pools-checklist-item-text {
  font-size: 13px;
  padding-right: 12px;
}

/* =========================================
   INACTIVE SERVICE VISUAL
========================================= */

.pools-checklist-service-inactive {
  opacity: 0.5;
  background: #f3f4f6;
}

.pools-checklist-service-inactive .pools-checklist-service-title {
  text-decoration: line-through;
}

/* =========================================
   SCHEDULE
========================================= */

.pool-schedules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pool-schedules-header {
  cursor: pointer;
}

/* ===== BADGE GRID ===== */

.schedule-badge-row {
  display: grid;
  grid-template-columns: 25% 50% 25%;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}

.badge-col-left {
  text-align: left;
}

.badge-col-center {
  text-align: center;
}

.badge-col-right {
  text-align: center;
}

/* ===== BADGES ===== */

.schedule-repeat-badge,
.schedule-tech-badge,
.schedule-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
}

.schedule-repeat-badge {
  background: #eef2ff;
  color: #4338ca;
}

.schedule-tech-badge {
  background: #f1f5f9;
  color: #0f172a;
}

.schedule-status {
  background: #f3f4f6;
}

/* ===== NEXT SECTION ===== */

.schedule-next-block {
  font-size: 13px;
  color: #555;
}

.schedule-next-row {
  margin-top: 4px;
}

.schedule-next-service strong,
.schedule-next-refresh strong {
  margin-left: 4px;
}

/* ===== GENERATE BUTTON ===== */

.schedule-generate-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  border: none;
  background: #f97316;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.schedule-generate-btn:hover {
  opacity: 0.85;
}

/* ==========================================
   FIX INPUTS CUADRADOS (DATE, TIME, NUMBER)
========================================== */

.clientes-input[type='date'],
.clientes-input[type='time'],
.clientes-input[type='number'] {
  border-radius: 10px !important;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #e3e3e3;
  background-color: #fff;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

/* Hover */
.clientes-input[type='date']:hover,
.clientes-input[type='time']:hover,
.clientes-input[type='number']:hover {
  border-color: #cfcfcf;
}

/* Focus elegante */
.clientes-input[type='date']:focus,
.clientes-input[type='time']:focus,
.clientes-input[type='number']:focus {
  border-color: var(--global-color-primary);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.12);
  outline: none;
}

input[type='date']::-webkit-calendar-picker-indicator,
input[type='time']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}
