/* ===================================================
   POOL PRO — Admin/Technician Portal Styles
   Extends portal.css with admin-specific components
   =================================================== */

/* -- Cartridge Filter Maintenance -- */
.pp-maint-kpis { display:flex; gap:var(--hps-space-4); margin-bottom:var(--hps-space-5); }
.pp-maint-kpis > div { flex:1; padding:var(--hps-space-5); border:1px solid var(--hps-border); border-radius:var(--hps-radius-md); background:var(--hps-surface); }
.pp-maint-kpis strong { display:block; color:var(--hps-primary); font-family:var(--hps-font-heading); font-size:2rem; }
.pp-maint-kpis span { color:var(--hps-text-muted); font-size:var(--hps-text-sm); }
.pp-maint-list { display:flex; flex-direction:column; gap:var(--hps-space-3); }
.pp-maint-row { display:flex; align-items:center; justify-content:space-between; gap:var(--hps-space-5); padding:var(--hps-space-5); border:1px solid var(--hps-border); border-radius:var(--hps-radius-md); background:var(--hps-surface); }
.pp-maint-row h3 { margin:var(--hps-space-2) 0 0; color:var(--hps-text); }
.pp-maint-row p { margin:var(--hps-space-1) 0 0; color:var(--hps-text-muted); }
.pp-maint-row dl { display:flex; gap:var(--hps-space-5); margin:0; }
.pp-maint-row dl div { min-width:72px; }
.pp-maint-row dt { color:var(--hps-text-muted); font-size:var(--hps-text-xs); text-transform:uppercase; letter-spacing:.05em; }
.pp-maint-row dd { margin:4px 0 0; color:var(--hps-text); font-weight:700; }
.pp-maint-actions { display:flex; gap:var(--hps-space-2); }
.pp-maint-status { display:inline-flex; padding:4px 10px; border-radius:999px; font-size:var(--hps-text-xs); font-weight:800; }
.pp-maint-status--psi_due,.pp-maint-status--overdue { color:#8b1e1e; background:#fee2e2; }
.pp-maint-status--due_soon { color:#77510a; background:#fef3c7; }
.pp-maint-status--current { color:#166534; background:#dcfce7; }
.pp-maint-empty { padding:var(--hps-space-6); border:1px dashed var(--hps-border); border-radius:var(--hps-radius-md); color:var(--hps-text-muted); text-align:center; }
@media (max-width:900px) { .pp-maint-row { align-items:flex-start; flex-direction:column; } .pp-maint-row dl { width:100%; flex-wrap:wrap; } }
@media (max-width:600px) { .pp-maint-kpis,.pp-maint-actions { flex-direction:column; } }

/* -- Filter cleaning routine block (customer add/edit form) -- */
.pp-filter-schedule { display:flex; flex-direction:column; gap:var(--hps-space-3); padding:var(--hps-space-4); margin-bottom:var(--hps-space-4); background:var(--hps-surface-alt); border:1px solid var(--hps-border); border-radius:var(--hps-radius-md); }
.pp-filter-schedule__head { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:0.05em; color:var(--hps-primary); }
.pp-filter-schedule #pp-cust-filter-nextdue { background:transparent; border:1px dashed var(--hps-border); font-weight:700; color:var(--hps-primary); cursor:default; }

/* -- Role Selector (Login) -- */
.pp-role-select {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-3);
  margin: var(--hps-space-5) 0;
}

.pp-role-card {
  display: block;
  cursor: pointer;
  padding: var(--hps-space-4);
  border: 2px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  background: var(--hps-surface);
  transition: var(--hps-transition);
}

.pp-role-card:hover {
  border-color: var(--hps-accent);
}

.pp-role-card.is-selected {
  border-color: var(--hps-primary);
  background: rgba(10, 35, 66, 0.05);
}

.pp-role-card input { display: none; }

.pp-role-card__content {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
}

.pp-role-card__content svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--hps-primary);
}

.pp-role-card__title {
  display: block;
  font-family: var(--hps-font-heading);
  font-weight: 700;
  font-size: var(--hps-text-base);
  color: var(--hps-text);
}

.pp-role-card__desc {
  display: block;
  font-size: var(--hps-text-sm);
  color: var(--hps-text-muted);
}

/* -- Role Badge (Top Bar) -- */
.pp-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: var(--hps-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(214, 178, 94, 0.15);
  color: var(--hps-primary);
  border: 1px solid rgba(214, 178, 94, 0.3);
}

/* -- Toolbar (Search + Filters) -- */
.pp-toolbar {
  display: flex;
  gap: var(--hps-space-3);
  margin-bottom: var(--hps-space-5);
  flex-wrap: wrap;
}

.pp-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  font-size: var(--hps-text-sm);
  font-family: var(--hps-font-body);
  background: var(--hps-surface);
  color: var(--hps-text);
  transition: var(--hps-transition);
}

.pp-search:focus {
  outline: none;
  border-color: var(--hps-primary);
  box-shadow: 0 0 0 3px rgba(10, 35, 66, 0.1);
}

.pp-filter {
  padding: 10px 16px;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  font-size: var(--hps-text-sm);
  font-family: var(--hps-font-body);
  background: var(--hps-surface);
  color: var(--hps-text);
  cursor: pointer;
}

.pp-filter:focus {
  outline: none;
  border-color: var(--hps-primary);
}

/* -- Customer Cell (table) -- */
.pp-customer-cell {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
}

.pp-customer-cell span {
  font-weight: 600;
  color: var(--hps-text);
}

/* -- Route Mini (dashboard) -- */
.pp-route-mini {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-2);
}

.pp-route-mini__item {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--hps-border);
}

.pp-route-mini__item:last-child {
  border-bottom: none;
}

.pp-route-mini__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hps-surface-alt);
  color: var(--hps-text-muted);
  font-weight: 700;
  font-size: var(--hps-text-xs);
  flex-shrink: 0;
}

.pp-route-mini__name {
  display: block;
  font-weight: 600;
  color: var(--hps-text);
  font-size: var(--hps-text-sm);
}

.pp-route-mini__addr {
  display: block;
  font-size: var(--hps-text-xs);
  color: var(--hps-text-muted);
}

/* -- Alerts -- */
.pp-alerts {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-3);
}

.pp-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--hps-space-3);
  padding: var(--hps-space-3);
  border-radius: var(--hps-radius-md);
  border-left: 4px solid;
}

.pp-alert--high {
  background: rgba(209, 26, 64, 0.08);
  border-color: #D11A40;
}

.pp-alert--medium {
  background: rgba(214, 137, 16, 0.08);
  border-color: #D68910;
}

.pp-alert--low {
  background: rgba(10, 35, 66, 0.08);
  border-color: var(--hps-primary);
}

.pp-alert__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.pp-alert--high .pp-alert__icon { color: #D11A40; }
.pp-alert--medium .pp-alert__icon { color: #D68910; }
.pp-alert--low .pp-alert__icon { color: var(--hps-primary); }

.pp-alert__title {
  display: block;
  font-weight: 700;
  font-size: var(--hps-text-sm);
  color: var(--hps-text);
}

.pp-alert__desc {
  display: block;
  font-size: var(--hps-text-xs);
  color: var(--hps-text-muted);
}

/* -- Route List (full route view) -- */
.pp-route-list {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-3);
}

.pp-route-stop {
  display: flex;
  gap: var(--hps-space-4);
  padding: var(--hps-space-4);
  background: var(--hps-surface);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  border-left: 4px solid var(--hps-border);
  transition: var(--hps-transition);
}

.pp-route-stop:hover {
  border-color: var(--hps-accent);
  box-shadow: var(--hps-shadow-sm);
}

.pp-route-stop--done {
  border-left-color: var(--hps-success);
  opacity: 0.75;
}

.pp-route-stop--active {
  border-left-color: var(--hps-primary);
  background: rgba(10, 35, 66, 0.03);
}

.pp-route-stop__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hps-surface-alt);
  color: var(--hps-text-muted);
  font-weight: 800;
  font-size: var(--hps-text-base);
  font-family: var(--hps-font-heading);
  flex-shrink: 0;
}

.pp-route-stop--done .pp-route-stop__num {
  background: rgba(67, 122, 34, 0.15);
  color: var(--hps-success);
}

.pp-route-stop--active .pp-route-stop__num {
  background: var(--hps-primary);
  color: #fff;
}

.pp-route-stop__body {
  flex: 1;
}

.pp-route-stop__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.pp-route-stop__name {
  font-family: var(--hps-font-heading);
  font-weight: 700;
  font-size: var(--hps-text-base);
  color: var(--hps-text);
}

.pp-route-stop__details {
  display: flex;
  gap: var(--hps-space-4);
  font-size: var(--hps-text-sm);
  color: var(--hps-text-muted);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.pp-route-stop__notes {
  font-size: var(--hps-text-sm);
  color: var(--hps-text-muted);
  padding: 8px 12px;
  background: var(--hps-surface-alt);
  border-radius: var(--hps-radius-sm);
  margin-bottom: var(--hps-space-2);
}

.pp-route-stop__actions {
  display: flex;
  gap: var(--hps-space-2);
}

/* -- Mini Buttons -- */
.pp-mini-btn {
  padding: 6px 14px;
  border: 1px solid var(--hps-primary);
  border-radius: var(--hps-radius-sm);
  background: transparent;
  color: var(--hps-primary);
  font-size: var(--hps-text-xs);
  font-weight: 600;
  font-family: var(--hps-font-body);
  cursor: pointer;
  transition: var(--hps-transition);
}

.pp-mini-btn:hover {
  background: var(--hps-primary);
  color: #fff;
}

.pp-mini-btn--ghost {
  border-color: var(--hps-border);
  color: var(--hps-text-muted);
}

.pp-mini-btn--ghost:hover {
  background: var(--hps-surface-alt);
  color: var(--hps-text);
}

/* -- Buttons -- */
.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--hps-radius-md);
  font-size: var(--hps-text-sm);
  font-weight: 600;
  font-family: var(--hps-font-body);
  cursor: pointer;
  transition: var(--hps-transition);
  border: none;
  white-space: nowrap;
}

.portal-btn--primary {
  background: var(--hps-gradient-cta);
  color: var(--hps-primary);
  font-weight: var(--hps-weight-bold);
}

.portal-btn--primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--hps-shadow-md);
}

.portal-btn--ghost {
  background: transparent;
  border: 1px solid var(--hps-border);
  color: var(--hps-text);
}

.portal-btn--ghost:hover {
  background: var(--hps-surface-alt);
  border-color: var(--hps-text-muted);
}

/* -- Chemistry Grid -- */
.pp-chem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--hps-space-3);
  margin-bottom: var(--hps-space-4);
}

.pp-chem-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pp-chem-input label {
  font-size: var(--hps-text-xs);
  font-weight: 600;
  color: var(--hps-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pp-chem-input input {
  padding: 8px 12px;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-sm);
  font-size: var(--hps-text-sm);
  font-family: var(--hps-font-body);
  background: var(--hps-surface);
  color: var(--hps-text);
  width: 100%;
}

.pp-chem-input input:focus {
  outline: none;
  border-color: var(--hps-primary);
  box-shadow: 0 0 0 2px rgba(10, 35, 66, 0.1);
}

/* -- LSI Calculator -- */
.pp-lsi-calc {
  margin-top: var(--hps-space-4);
  padding: var(--hps-space-5);
  background: linear-gradient(135deg, #0A2342 0%, #06172B 100%);
  border-radius: 12px;
  border: 1px solid rgba(214, 178, 94, 0.2);
}

.pp-lsi-calc__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--hps-space-4);
}

.pp-lsi-calc__title {
  display: block;
  font-family: var(--hps-font-heading);
  font-size: 15px;
  font-weight: 700;
  color: #F7F6F2;
}

.pp-lsi-calc__hint {
  display: block;
  font-size: 11px;
  color: rgba(247, 246, 242, 0.5);
  margin-top: 2px;
}

.pp-lsi-calc__value-wrap {
  text-align: right;
}

.pp-lsi-calc__value {
  display: block;
  font-family: var(--hps-font-heading);
  font-size: 32px;
  font-weight: 800;
  color: rgba(247, 246, 242, 0.4);
  line-height: 1;
}

.pp-lsi-calc__value--bal { color: #6DAA45; }
.pp-lsi-calc__value--corr { color: #DD6974; }
.pp-lsi-calc__value--scale { color: #FDAB43; }

.pp-lsi-calc__status {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(247, 246, 242, 0.5);
  margin-top: 4px;
}

.pp-lsi-calc__status--bal { color: #6DAA45; }
.pp-lsi-calc__status--corr { color: #DD6974; }
.pp-lsi-calc__status--scale { color: #FDAB43; }

/* Gauge */
.pp-lsi-gauge {
  position: relative;
  margin: var(--hps-space-4) 0 var(--hps-space-2) 0;
}

.pp-lsi-gauge__track {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.pp-lsi-gauge__zone--corr {
  flex: 35;
  background: linear-gradient(90deg, #A13544 0%, #DD6974 100%);
}

.pp-lsi-gauge__zone--bal {
  flex: 30;
  background: linear-gradient(90deg, #437A22 0%, #6DAA45 50%, #437A22 100%);
}

.pp-lsi-gauge__zone--scale {
  flex: 35;
  background: linear-gradient(90deg, #DA7101 0%, #FDAB43 100%);
}

.pp-lsi-gauge__marker {
  position: absolute;
  top: -4px;
  transform: translateX(-50%);
  transition: left 0.3s ease;
  z-index: 2;
}

.pp-lsi-gauge__pin {
  width: 3px;
  height: 18px;
  background: #F7F6F2;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.pp-lsi-gauge__labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(247, 246, 242, 0.4);
  margin-bottom: var(--hps-space-4);
}

/* Detail chips */
.pp-lsi-calc__details {
  display: flex;
  gap: var(--hps-space-2);
  flex-wrap: wrap;
  margin-bottom: var(--hps-space-3);
}

.pp-lsi-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  min-width: 80px;
}

.pp-lsi-chip__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(247, 246, 242, 0.4);
}

.pp-lsi-chip__val {
  font-size: 13px;
  font-weight: 700;
  color: #F7F6F2;
  margin-top: 2px;
  font-family: var(--hps-font-heading);
}

/* Recommendation */
.pp-lsi-calc__rec {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(247, 246, 242, 0.7);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border-left: 3px solid var(--hps-accent);
}

/* -- Balance-to-LSI-0.00 plan -- */
.pp-lsi-plan { display: flex; flex-direction: column; gap: 10px; }
.pp-lsi-plan--ok {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #7ee0b0;
  font-weight: 600;
}
.pp-lsi-plan__check {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(126, 224, 176, 0.15);
  color: #7ee0b0;
  font-size: 12px;
  flex-shrink: 0;
}
.pp-lsi-plan__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.pp-lsi-plan__title {
  font-family: var(--hps-font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #F7F6F2;
}
.pp-lsi-plan__proj {
  font-size: 12px;
  font-weight: 700;
  color: var(--hps-primary, #0A2342);
  background: var(--hps-accent);
  padding: 3px 10px;
  border-radius: 999px;
}
.pp-lsi-plan__targets { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-lsi-plan__tgt {
  font-size: 12px;
  color: rgba(247, 246, 242, 0.6);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 10px;
}
.pp-lsi-plan__tgt b { color: #F7F6F2; font-weight: 700; }
.pp-lsi-plan__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: lsi-step;
}
.pp-lsi-plan__step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.pp-lsi-plan__amt {
  font-family: var(--hps-font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--hps-accent);
  white-space: nowrap;
  min-width: 74px;
}
.pp-lsi-plan__chem {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
  font-weight: 600;
  color: #F7F6F2;
}
.pp-lsi-plan__why {
  font-size: 11px;
  font-weight: 500;
  color: rgba(247, 246, 242, 0.55);
}
.pp-lsi-plan__reason {
  display: block;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(247, 246, 242, 0.45);
  margin-top: 3px;
}
.pp-lsi-plan__none,
.pp-lsi-plan__note,
.pp-lsi-plan__foot {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(247, 246, 242, 0.5);
  margin: 0;
}
.pp-lsi-plan__note { color: rgba(247, 202, 148, 0.85); }

/* Responsive */
@media (max-width: 520px) {
  .pp-lsi-calc__header {
    flex-direction: column;
    gap: var(--hps-space-2);
  }
  .pp-lsi-calc__value-wrap {
    text-align: left;
  }
  .pp-lsi-calc__value {
    font-size: 28px;
  }
  .pp-lsi-chip {
    flex: 1;
  }
}

/* -- Sanitizer / Chlorine Guide panels -- */
.pp-chem-recs {
  margin-top: var(--hps-space-3);
  padding: var(--hps-space-5);
  background: #F9F8F5;
  border-radius: 12px;
  border: 1px solid var(--hps-border);
}

.pp-chem-recs__header {
  margin-bottom: var(--hps-space-3);
}

.pp-chem-recs__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--hps-font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--hps-primary);
}

.pp-chem-recs__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pp-chem-recs__hint {
  display: block;
  font-size: 11px;
  color: var(--hps-text-muted);
  margin-top: 2px;
}

.pp-chem-recs__empty {
  font-size: 13px;
  color: var(--hps-text-muted);
  text-align: center;
  padding: var(--hps-space-4);
  margin: 0;
  border: 1px dashed var(--hps-border);
  border-radius: 10px;
}

.pp-chem-recs__note {
  font-size: 12px;
  color: var(--hps-text-muted);
  padding: 8px 12px;
  background: var(--hps-surface-alt);
  border-radius: 8px;
  margin-bottom: var(--hps-space-3);
  line-height: 1.4;
}

.pp-chem-rec {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--hps-border);
  transition: border-color 0.2s;
}

.pp-chem-rec:last-child {
  margin-bottom: 0;
}

.pp-chem-rec__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pp-chem-rec__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--hps-primary);
  font-family: var(--hps-font-heading);
}

.pp-chem-rec__purpose {
  font-size: 12px;
  color: var(--hps-text-muted);
}

.pp-chem-rec__why {
  display: block;
  font-size: 11px;
  line-height: 1.45;
  color: var(--hps-text-muted);
  margin-top: 3px;
}

.pp-chem-rec__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.pp-chem-rec__amt {
  font-size: 15px;
  font-weight: 800;
  color: var(--hps-primary);
  font-family: var(--hps-font-heading);
  white-space: nowrap;
}

.pp-chem-rec__pri {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 100px;
}

.pp-chem-rec__pri--high {
  background: rgba(161, 44, 123, 0.1);
  color: var(--hps-error);
}

.pp-chem-rec__pri--med {
  background: rgba(150, 66, 25, 0.1);
  color: var(--hps-warning);
}

.pp-chem-rec__pri--low {
  background: rgba(110, 127, 145, 0.1);
  color: var(--hps-steel);
}

/* Flexible scheduling settings and duration segments */
.pp-calendar__settings { margin: 0 0 var(--hps-space-4); }
.pp-calendar__settings summary { display: flex; align-items: center; justify-content: space-between; gap: var(--hps-space-3); cursor: pointer; }
.pp-calendar__settings summary span { color: var(--hps-text-muted); font-size: 14px; }
.pp-calendar__settings form { display: flex; flex-direction: column; gap: var(--hps-space-4); padding-top: var(--hps-space-4); }
.pp-calendar__days { display: flex; flex-wrap: wrap; gap: var(--hps-space-3); border: 0; padding: 0; }
.pp-calendar__days legend { width: 100%; margin-bottom: var(--hps-space-2); font-weight: 700; }
.pp-calendar__days label, .pp-calendar__override { display: flex; align-items: center; gap: var(--hps-space-2); color: var(--hps-text); font-size: 14px; }
.pp-calendar__days input, .pp-calendar__override input { width: 16px; height: 16px; }
.pp-calendar__segments { display: flex; flex-wrap: wrap; gap: var(--hps-space-2); margin-top: var(--hps-space-2); }
.pp-calendar__segment { border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; background: var(--hps-surface-alt); color: var(--hps-text-muted); }
.pp-calendar__segment--job { background: var(--hps-accent); color: var(--hps-primary); }

/* -- Chlorine guide: status hero, best card, warnings -- */
.pp-cl-status {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid;
}
.pp-cl-status--ok {
  background: rgba(42, 157, 92, 0.08);
  border-color: rgba(42, 157, 92, 0.35);
}
.pp-cl-status--low {
  background: rgba(214, 69, 69, 0.07);
  border-color: rgba(214, 69, 69, 0.30);
}
.pp-cl-status--high {
  background: rgba(232, 148, 26, 0.10);
  border-color: rgba(232, 148, 26, 0.40);
}
.pp-cl-status__body {
  min-width: 0;
}
.pp-cl-status__pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 100px;
  padding: 3px 10px;
  margin-bottom: 8px;
}
.pp-cl-status--ok .pp-cl-status__pill {
  background: rgba(42, 157, 92, 0.15);
  color: #1E7A46;
}
.pp-cl-status--low .pp-cl-status__pill {
  background: rgba(214, 69, 69, 0.12);
  color: #B03232;
}
.pp-cl-status--high .pp-cl-status__pill {
  background: rgba(232, 148, 26, 0.20);
  color: #9A5F0A;
}
.pp-cl-status__head {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--hps-primary);
  line-height: 1.45;
}
.pp-cl-status__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pp-cl-status__meta span {
  font-size: 11px;
  font-weight: 700;
  color: var(--hps-text-muted);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(10, 35, 66, 0.10);
  padding: 2px 9px;
  border-radius: 100px;
  white-space: nowrap;
}
.pp-cl-status__fc {
  text-align: right;
  flex-shrink: 0;
}
.pp-cl-status__num {
  display: block;
  font-family: var(--hps-font-heading);
  font-size: 30px;
  font-weight: 800;
  color: var(--hps-primary);
  line-height: 1;
}
.pp-cl-status__lbl {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hps-text-muted);
  margin-top: 4px;
}
.pp-chem-rec--best {
  border-color: var(--hps-accent);
  background: #FDF9EF;
}
.pp-chem-rec__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7A5C14;
  background: var(--hps-accent-light);
  border: 1px solid var(--hps-accent);
  border-radius: 100px;
  padding: 1px 8px;
  margin-left: 8px;
  vertical-align: 2px;
  white-space: nowrap;
}
.pp-cl-warn {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.45;
  color: var(--hps-text);
  background: rgba(232, 148, 26, 0.10);
  border: 1px solid rgba(232, 148, 26, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
}
.pp-cl-warn__icon {
  color: var(--hps-warning);
  font-weight: 700;
}

/* Previous-visit readings next to the entry fields */
.pp-chem-prev-cap {
  font-size: 11px;
  font-weight: 700;
  color: var(--hps-text-muted);
  margin: 0 0 8px;
}
.pp-chem-prev-cap:empty {
  display: none;
}
.pp-chem-prev {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--hps-text-muted);
}
.pp-chem-prev:empty {
  display: none;
}

/* Pool volume field */
.pp-chem-input--wide {
  grid-column: 1 / -1;
}

.pp-chem-input--wide input {
  max-width: 200px;
}

/* Responsive */
@media (max-width: 520px) {
  .pp-chem-rec {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .pp-chem-rec__right {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }
}

/* -- Checklist -- */
.pp-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-3);
}

.pp-check {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  cursor: pointer;
  font-size: var(--hps-text-sm);
  color: var(--hps-text);
}

.pp-check input {
  display: none;
}

.pp-check__mark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--hps-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--hps-transition);
}

.pp-check input:checked + .pp-check__mark {
  background: var(--hps-primary);
  border-color: var(--hps-primary);
}

.pp-check input:checked + .pp-check__mark::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* -- Chemicals Added -- */
.pp-chem-added {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-2);
}

.pp-chem-added__item {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  font-size: var(--hps-text-sm);
  color: var(--hps-text);
}

.pp-chem-added__item span:first-child {
  flex: 1;
  font-weight: 500;
}

.pp-chem-added__item input {
  padding: 6px 10px;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-sm);
  font-size: var(--hps-text-sm);
  font-family: var(--hps-font-body);
  background: var(--hps-surface);
  color: var(--hps-text);
}

.pp-chem-added__item span:last-child {
  font-size: var(--hps-text-xs);
  color: var(--hps-text-muted);
  min-width: 50px;
}

.pp-chem-added__group {
  font-size: var(--hps-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hps-text-muted);
  margin-top: var(--hps-space-2);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hps-border);
}

.pp-chem-added__group:first-child { margin-top: 0; }

.pp-chem-stayout {
  display: flex;
  align-items: center;
  gap: var(--hps-space-2);
  margin-top: var(--hps-space-4);
  padding: 10px 12px;
  background: var(--hps-surface-alt);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-sm);
  font-size: var(--hps-text-sm);
  font-weight: 500;
  color: var(--hps-text);
  cursor: pointer;
}

.pp-chem-stayout input { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }

/* -- Visit Actions -- */
.pp-visit-actions {
  display: flex;
  gap: var(--hps-space-3);
  margin-top: var(--hps-space-4);
  flex-wrap: wrap;
}

/* -- Request Queue -- */
.pp-request-queue {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-4);
}

.pp-req-card {
  padding: var(--hps-space-4);
  background: var(--hps-surface);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  border-left: 4px solid var(--hps-border);
}

.pp-req-card--high { border-left-color: #D11A40; }
.pp-req-card--medium { border-left-color: #D68910; }
.pp-req-card--low { border-left-color: var(--hps-primary); }

.pp-req-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pp-req-card__id {
  font-size: var(--hps-text-xs);
  font-weight: 700;
  color: var(--hps-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: var(--hps-space-2);
}

.pp-req-card__subject {
  font-family: var(--hps-font-heading);
  font-weight: 700;
  font-size: var(--hps-text-base);
  color: var(--hps-text);
}

.pp-req-card__meta {
  display: flex;
  gap: var(--hps-space-2);
  font-size: var(--hps-text-xs);
  color: var(--hps-text-muted);
  margin-bottom: 6px;
}

.pp-req-card p {
  font-size: var(--hps-text-sm);
  color: var(--hps-text);
  margin-bottom: var(--hps-space-3);
}

.pp-req-card__footer {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  font-size: var(--hps-text-xs);
  color: var(--hps-text-muted);
}

/* -- Bar Chart -- */
.pp-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--hps-space-3);
  height: 200px;
  padding: var(--hps-space-4) 0;
}

.pp-bar-chart__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.pp-bar-chart__bar {
  width: 100%;
  max-width: 48px;
  background: var(--hps-accent);
  border-radius: var(--hps-radius-sm) var(--hps-radius-sm) 0 0;
  position: relative;
  transition: height 0.3s ease;
  min-height: 4px;
}

.pp-bar-chart__bar--current {
  background: var(--hps-primary);
}

.pp-bar-chart__val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--hps-text-xs);
  font-weight: 700;
  color: var(--hps-text);
  white-space: nowrap;
}

.pp-bar-chart__label {
  font-size: var(--hps-text-xs);
  color: var(--hps-text-muted);
  font-weight: 600;
}

/* -- Plan Breakdown -- */
.pp-plan-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-4);
}

.pp-plan-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pp-plan-stat__name {
  font-size: var(--hps-text-sm);
  font-weight: 600;
  color: var(--hps-text);
}

.pp-plan-stat__bar {
  height: 12px;
  background: var(--hps-surface-alt);
  border-radius: 100px;
  overflow: hidden;
}

.pp-plan-stat__bar > div {
  height: 100%;
  border-radius: 100px;
  transition: width 0.3s ease;
}

.pp-plan-stat__count {
  font-size: var(--hps-text-xs);
  color: var(--hps-text-muted);
}

.pp-city-list {
  margin-top: var(--hps-space-4);
  padding-top: var(--hps-space-4);
  border-top: 1px solid var(--hps-border);
  font-size: var(--hps-text-xs);
  color: var(--hps-text-muted);
  line-height: 1.6;
}

/* -- Photo Grid -- */
.pp-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--hps-space-3);
}

.pp-photo-tile {
  border-radius: var(--hps-radius-md);
  overflow: hidden;
  background: var(--hps-surface-alt);
  border: 1px solid var(--hps-border);
}

.pp-photo-tile__img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--hps-radius-sm) var(--hps-radius-sm) 0 0;
}

.pp-photo-tile__info {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pp-photo-tile__info span:first-child {
  font-size: var(--hps-text-xs);
  font-weight: 600;
  color: var(--hps-text);
}

.pp-photo-tile__info span:last-child {
  font-size: 10px;
  color: var(--hps-text-muted);
}

/* Reuse portal photo gradient placeholders */
.portal-photo__img--1 { background: linear-gradient(135deg, #0A2342, #00A6C8); }
.portal-photo__img--2 { background: linear-gradient(135deg, #00A6C8, #90E0EF); }
.portal-photo__img--3 { background: linear-gradient(135deg, #06172B, #0A2342); }
.portal-photo__img--4 { background: linear-gradient(135deg, #0A2342, #00805A); }
.portal-photo__img--5 { background: linear-gradient(135deg, #06172B, #1B3A5C); }
.portal-photo__img--6 { background: linear-gradient(135deg, #006D8F, #00A6C8); }
.portal-photo__img--7 { background: linear-gradient(135deg, #06172B, #00805A); }
.portal-photo__img--8 { background: linear-gradient(135deg, #00805A, #0A2342); }
.portal-photo__img--9 { background: linear-gradient(135deg, #00A6C8, #06172B); }
.portal-photo__img--10 { background: linear-gradient(135deg, #06172B, #00805A); }

/* -- Upload Area -- */
.portal-upload {
  margin-bottom: var(--hps-space-4);
}

.portal-upload__input {
  display: none;
}

.portal-upload__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--hps-space-2);
  padding: var(--hps-space-6);
  border: 2px dashed var(--hps-border);
  border-radius: var(--hps-radius-md);
  background: var(--hps-surface-alt);
  cursor: pointer;
  transition: var(--hps-transition);
  color: var(--hps-text-muted);
  font-size: var(--hps-text-sm);
  text-align: center;
}

.portal-upload__label:hover {
  border-color: var(--hps-accent);
  color: var(--hps-primary);
}

/* ===== Visit Photo Upload ===== */
.pp-visit-photos {
  margin-bottom: var(--hps-space-4);
}

.pp-visit-photos__dropzone {
  border: 2px dashed var(--hps-border);
  border-radius: var(--hps-radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--hps-text-muted);
}

.pp-visit-photos__dropzone:hover {
  border-color: var(--hps-accent);
  background: var(--hps-surface-alt);
}

.pp-visit-photos__dropzone--over {
  border-color: var(--hps-pool);
  background: rgba(0,166,200,0.05);
}

.pp-visit-photos__preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.pp-visit-photo__thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
}

.pp-visit-photo__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pp-visit-photo__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.7));
  padding: 6px;
  gap: 6px;
  opacity: 1;
}

.pp-visit-photo__label {
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.pp-visit-photo__label-select {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
}

.pp-visit-photo__label-select option {
  color: #0A2342;
}

.pp-visit-photo__remove {
  background: rgba(221,105,116,0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pp-visit-photo__remove:hover {
  background: var(--hps-error);
}

.portal-upload__label svg {
  width: 32px;
  height: 32px;
}

/* -- Form Success Banner -- */
.portal-form__success {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  padding: var(--hps-space-3) var(--hps-space-4);
  background: rgba(67, 122, 34, 0.1);
  border: 1px solid rgba(67, 122, 34, 0.3);
  border-radius: var(--hps-radius-md);
  color: var(--hps-success);
  font-weight: 600;
  font-size: var(--hps-text-sm);
  margin-bottom: var(--hps-space-4);
}

.portal-form__success svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* -- Form Row -- */
.portal-form__row {
  display: flex;
  gap: var(--hps-space-3);
}

.portal-form__row .portal-form__field {
  flex: 1;
}

.portal-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--hps-space-4);
}

.portal-form__field label {
  font-size: var(--hps-text-xs);
  font-weight: 600;
  color: var(--hps-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal-form__field input,
.portal-form__field select,
.portal-form__field textarea {
  padding: 10px 14px;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  font-size: var(--hps-text-sm);
  font-family: var(--hps-font-body);
  background: var(--hps-surface);
  color: var(--hps-text);
  width: 100%;
  box-sizing: border-box;
}

.portal-form__field input:focus,
.portal-form__field select:focus,
.portal-form__field textarea:focus {
  outline: none;
  border-color: var(--hps-primary);
  box-shadow: 0 0 0 3px rgba(10, 35, 66, 0.1);
}

.portal-form__field textarea {
  resize: vertical;
  min-height: 60px;
}

/* -- Modal -- */
.pp-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pp-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 62, 94, 0.5);
  backdrop-filter: blur(4px);
}

.pp-modal__card {
  position: relative;
  background: var(--hps-surface);
  border-radius: var(--hps-radius-lg);
  box-shadow: var(--hps-shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
}

.pp-modal__card--wide {
  max-width: 720px;
}

.pp-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--hps-space-5) var(--hps-space-6);
  border-bottom: 1px solid var(--hps-border);
  position: sticky;
  top: 0;
  background: var(--hps-surface);
  z-index: 2;
}

.pp-modal__header h2 {
  font-family: var(--hps-font-heading);
  font-size: var(--hps-text-lg);
  font-weight: 700;
  color: var(--hps-text);
}

.pp-modal__close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--hps-text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--hps-transition);
}

.pp-modal__close:hover {
  background: var(--hps-surface-alt);
  color: var(--hps-text);
}

.pp-modal__form {
  padding: var(--hps-space-6);
}

.pp-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hps-space-3);
  justify-content: flex-end;
  margin-top: var(--hps-space-5);
  padding-top: var(--hps-space-4);
  border-top: 1px solid var(--hps-border);
}

/* Customer detail: pin actions to the bottom of the scrolling card so
   every button (including Close) stays reachable no matter how tall the
   record is. */
.pp-customer-detail .pp-modal__actions {
  position: sticky;
  bottom: 0;
  background: var(--hps-surface);
  margin-top: var(--hps-space-6);
  padding-bottom: var(--hps-space-2);
  z-index: 2;
}

/* -- Customer Detail Modal -- */
.pp-customer-detail {
  padding: var(--hps-space-6);
}

.pp-customer-detail__section {
  margin-bottom: var(--hps-space-5);
}

.pp-customer-detail__section h3 {
  font-family: var(--hps-font-heading);
  font-size: var(--hps-text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hps-text-muted);
  margin-bottom: var(--hps-space-3);
}

.pp-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--hps-space-4);
}

.pp-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pp-detail-label {
  font-size: var(--hps-text-xs);
  color: var(--hps-text-muted);
  font-weight: 600;
}

.pp-detail-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-2);
}

.pp-detail-tl-item {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--hps-border);
  font-size: var(--hps-text-sm);
  color: var(--hps-text);
}

.pp-detail-tl-item:last-child {
  border-bottom: none;
}

.pp-detail-tl-item > span:first-child {
  font-weight: 600;
  color: var(--hps-text-muted);
  min-width: 70px;
  flex-shrink: 0;
}

/* -- Portal Split (two columns) -- */
.portal-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--hps-space-5);
  margin-bottom: var(--hps-space-5);
}

/* -- Table Link Button -- */
.portal-table__link {
  background: none;
  border: none;
  color: var(--hps-primary);
  font-size: var(--hps-text-sm);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: var(--hps-transition);
}

.portal-table__link:hover {
  text-decoration: underline;
}

/* -- Mobile Menu Button (hidden on desktop) -- */
.portal-topbar__menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--hps-text-inverse, #fff);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--hps-radius-sm);
  transition: var(--hps-transition);
}

.portal-topbar__menu-btn svg {
  width: 24px;
  height: 24px;
}

/* -- Mobile Sidebar Overlay -- */
.portal-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 62, 94, 0.5);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portal-sidebar-overlay.is-visible {
  opacity: 1;
}

/* -- Responsive -- */
@media (max-width: 900px) {
  .pp-chem-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pp-photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .portal-split {
    grid-template-columns: 1fr;
  }

  .pp-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  /* Show hamburger menu button */
  .portal-topbar__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Sidebar slides in from left */
  .portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
    box-shadow: var(--hps-shadow-lg);
    height: 100vh;
    overflow-y: auto;
  }

  .portal-sidebar.is-open {
    transform: translateX(0);
  }

  /* Show overlay when sidebar is open */
  .portal-sidebar-overlay.is-visible {
    display: block;
  }

  .pp-chem-grid {
    grid-template-columns: 1fr;
  }

  .pp-photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pp-detail-grid {
    grid-template-columns: 1fr;
  }

  .pp-toolbar {
    flex-direction: column;
  }

  .pp-search {
    width: 100%;
  }

  .pp-bar-chart {
    gap: var(--hps-space-1);
    height: 150px;
  }

  .pp-bar-chart__val {
    font-size: 9px;
  }

  .portal-form__row {
    flex-direction: column;
  }

  .pp-modal__card {
    width: 95%;
    max-height: 90vh;
  }

  .pp-route-stop__details {
    flex-direction: column;
    gap: 2px;
  }

  .pp-route-stop__actions {
    flex-wrap: wrap;
  }

  .pp-visit-actions {
    flex-direction: column;
  }

  .pp-visit-actions .portal-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .pp-photo-grid {
    grid-template-columns: 1fr;
  }
}

/* Nav badges (leads, password resets, etc.) */
.pp-nav-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--hps-primary);
  border: 1px solid var(--hps-accent);
  border-radius: 9px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Table action buttons (leads, etc.) */
.pp-table-btn {
  display: inline-block;
  background: none;
  border: 1px solid var(--hps-border);
  border-radius: 6px;
  padding: 4px 10px;
  margin: 2px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.pp-table-btn:hover {
  background: var(--hps-bg-alt);
  border-color: var(--hps-pool);
}

/* ============================================
   TECH MODE — Mobile-Optimized Technician UI
   ============================================ */

.pp-tech-mode {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 12px 80px;
}

/* Hide tech-only nav for admin on desktop; show on mobile */
.pp-tech-only { display: none; }
body.pp-role-tech .pp-tech-only { display: flex; }
@media (max-width: 768px) {
  .pp-tech-only { display: flex; }
}

/* Tech Header */
.pp-tech-header {
  text-align: center;
  margin-bottom: 20px;
}

.pp-tech-header__title {
  font-family: var(--hps-font-heading);
  font-size: 28px;
  font-weight: 800;
  color: var(--hps-primary);
  margin: 0;
}

.pp-tech-header__date {
  color: var(--hps-text-muted);
  font-size: 14px;
  margin: 4px 0 16px;
}

.pp-tech-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.pp-tech-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pp-tech-stat__num {
  font-family: var(--hps-font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--hps-primary);
  line-height: 1;
}

.pp-tech-stat__num--done { color: var(--hps-success); }
.pp-tech-stat__num--total { color: var(--hps-text-muted); }

.pp-tech-stat__label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--hps-text-muted);
  margin-top: 4px;
  font-weight: 600;
}

/* Route Stop Cards */
.pp-tech-stop {
  background: var(--hps-surface);
  border-radius: 16px;
  border: 1px solid var(--hps-border);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(10,35,66,0.06);
}

.pp-tech-stop--done {
  opacity: 0.65;
  border-color: var(--hps-success);
}

.pp-tech-stop__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.pp-tech-stop__name {
  font-family: var(--hps-font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--hps-primary);
  margin: 0;
}

.pp-tech-stop__badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  flex-shrink: 0;
}

.pp-tech-stop__badge--pending { background: rgba(150,66,25,0.12); color: var(--hps-warning); }
.pp-tech-stop__badge--in-progress { background: rgba(0,109,143,0.12); color: var(--hps-pool-dark); }
.pp-tech-stop__badge--completed { background: rgba(67,122,34,0.12); color: var(--hps-success); }

.pp-tech-stop__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.pp-tech-stop__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 15px;
  color: var(--hps-text);
}

.pp-tech-stop__row svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--hps-text-muted);
}

.pp-tech-stop__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--hps-text-muted);
  margin-right: 6px;
}

.pp-tech-stop__code {
  display: inline-block;
  background: var(--hps-accent);
  color: var(--hps-primary);
  font-weight: 700;
  font-size: 14px;
  padding: 2px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}

/* Big Action Buttons */
.pp-tech-actions {
  display: flex;
  gap: 10px;
}

.pp-tech-btn {
  flex: 1;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--hps-font-heading);
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  padding: 12px 16px;
}

.pp-tech-btn:active { transform: scale(0.97); }

.pp-tech-btn--primary {
  background: var(--hps-gradient-cta);
  color: var(--hps-primary);
}

.pp-tech-btn--success {
  background: var(--hps-success);
  color: #fff;
}

.pp-tech-btn--ghost {
  background: var(--hps-surface-alt);
  color: var(--hps-primary);
  border: 2px solid var(--hps-border);
}

.pp-tech-btn--call {
  background: var(--hps-success);
  color: #fff;
  flex: 0 0 56px;
  min-width: 56px;
}

.pp-tech-btn--map {
  background: var(--hps-pool-dark);
  color: #fff;
  flex: 0 0 56px;
  min-width: 56px;
}

.pp-tech-btn svg { width: 22px; height: 22px; }

/* Quick Complete Panel */
.pp-tech-quick {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--hps-border);
}

.pp-tech-quick.is-open { display: block; }

.pp-tech-quick__title {
  font-family: var(--hps-font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--hps-primary);
  margin: 0 0 12px;
  text-transform: uppercase;
}

.pp-tech-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.pp-tech-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 14px;
  background: var(--hps-surface-alt);
  border: 2px solid var(--hps-border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--hps-text);
  transition: background 0.15s, border-color 0.15s;
}

.pp-tech-check.is-checked {
  background: rgba(67,122,34,0.08);
  border-color: var(--hps-success);
  color: var(--hps-success);
}

.pp-tech-check__box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--hps-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.pp-tech-check.is-checked .pp-tech-check__box {
  background: var(--hps-success);
  border-color: var(--hps-success);
  color: #fff;
}

.pp-tech-quick__notes {
  width: 100%;
  min-height: 60px;
  padding: 12px;
  border: 2px solid var(--hps-border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.pp-tech-quick__notes:focus {
  outline: none;
  border-color: var(--hps-pool);
}

.pp-tech-complete {
  width: 100%;
  min-height: 60px;
  background: var(--hps-gradient-cta);
  color: var(--hps-primary);
  font-family: var(--hps-font-heading);
  font-size: 18px;
  font-weight: 800;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s;
}

.pp-tech-complete:active { transform: scale(0.98); }

.pp-tech-complete svg { width: 24px; height: 24px; }

/* Empty state */
.pp-tech-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--hps-text-muted);
}

.pp-tech-empty svg {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: block;
  opacity: 0.4;
}

.pp-tech-empty p {
  font-size: 16px;
  margin: 0;
}

/* Mobile responsive tech mode */
@media (max-width: 480px) {
  .pp-tech-mode { padding: 12px 8px 100px; }
  .pp-tech-header__title { font-size: 24px; }
  .pp-tech-stats { gap: 16px; }
  .pp-tech-stat__num { font-size: 26px; }
  .pp-tech-stop { padding: 16px; }
  .pp-tech-stop__name { font-size: 18px; }
  .pp-tech-checklist { grid-template-columns: 1fr; }
  .pp-tech-btn { font-size: 15px; min-height: 52px; }
  .pp-tech-complete { font-size: 16px; min-height: 56px; }
}

/* Tech Mode Photo Upload */
.pp-tech-photos {
  margin-bottom: 12px;
}

.pp-tech-photo-btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--hps-surface-alt);
  border: 2px dashed var(--hps-border);
  border-radius: 12px;
  color: var(--hps-primary);
  font-family: var(--hps-font-heading);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pp-tech-photo-btn:hover, .pp-tech-photo-btn:active {
  background: rgba(0,166,200,0.06);
  border-color: var(--hps-pool);
}

.pp-tech-photo-btn svg { width: 22px; height: 22px; }

.pp-tech-photos__preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.pp-tech-photo__thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
}

.pp-tech-photo__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pp-tech-photo__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px 6px;
  background: linear-gradient(to bottom, rgba(10,35,66,0.5) 0%, transparent 50%);
}

.pp-tech-photo__label {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.pp-tech-photo__remove {
  background: rgba(0,0,0,0.5);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.pp-tech-photo__remove svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

.pp-tech-photo__remove:hover {
  background: rgba(221,105,116,0.8);
}

/* iPhone touch targets — 44px minimum */
@media (max-width: 768px) {
  .portal-btn,
  .portal-login__submit,
  .portal-nav__link,
  .portal-tab,
  .pp-btn,
  .pp-nav__link,
  .pp-tab,
  .pp-login__submit,
  .pp-form__input,
  .pp-form__select,
  .pp-form__textarea,
  .portal-form__input,
  .portal-form__select,
  .portal-form__textarea {
    min-height: 44px;
  }
  .pp-role-select {
    gap: var(--hps-space-2);
    margin: var(--hps-space-3) 0;
  }
  .pp-role-card {
    padding: var(--hps-space-2) var(--hps-space-3);
    min-height: 44px;
  }
  .pp-role-card__content svg {
    width: 20px;
    height: 20px;
  }
  .pp-role-card__desc {
    font-size: var(--hps-text-xs);
  }
  .portal-login__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* iPhone SE — compact role cards */
@media (max-width: 380px) {
  .pp-role-card__desc {
    display: none;
  }
  .pp-role-select {
    flex-direction: row;
  }
  .pp-role-card {
    flex: 1;
    padding: 6px 8px;
  }
  .pp-role-card__content {
    flex-direction: column;
    text-align: center;
    gap: 2px;
  }
  .pp-role-card__content svg {
    width: 18px;
    height: 18px;
  }
}

/* iPhone SE — extra compaction for pool-pro login */
@media (max-width: 400px) {
  #pp-login-screen .portal-login__card {
    padding: var(--hps-space-4) !important;
  }
  #pp-login-screen .portal-login__logo {
    margin-bottom: var(--hps-space-3) !important;
  }
  #pp-login-screen .portal-login__veteran-badge {
    margin-bottom: var(--hps-space-2) !important;
    padding: 3px 10px !important;
  }
  #pp-login-screen .portal-login__veteran-img {
    width: 20px !important;
    height: 26px !important;
  }
  #pp-login-screen .pp-role-select {
    margin: var(--hps-space-2) 0 !important;
  }
}

/* ===== Per-customer monthly pricing block (Add/Edit form) ===== */
.pp-pricing-block {
  margin: var(--hps-space-4) 0;
  padding: var(--hps-space-4);
  border: 1px solid var(--hps-border, #e2e8f0);
  border-radius: var(--hps-radius-lg, 12px);
  background: var(--hps-bg-subtle, #f8fafc);
}
.pp-pricing-block__head {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hps-text-muted, #64748b);
  margin-bottom: var(--hps-space-3);
}
.pp-price-hint {
  margin: var(--hps-space-2) 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--hps-text-muted, #64748b);
}

/* ================================================================
   STORE MANAGER
   ================================================================ */
.pp-store-hint {
  font-weight: var(--hps-weight-regular);
  font-size: 13px;
  color: var(--hps-text-muted);
}

/* Unlock prompt */
.pp-store-unlock__inner {
  display: flex;
  gap: var(--hps-space-4);
  align-items: flex-start;
  padding: var(--hps-space-2);
}
.pp-store-unlock__inner > svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--hps-primary);
  margin-top: 2px;
}
.pp-store-unlock__body h3 {
  margin: 0 0 var(--hps-space-1);
  font-size: var(--hps-text-lg);
  color: var(--hps-text);
}
.pp-store-unlock__body p {
  margin: 0 0 var(--hps-space-3);
  color: var(--hps-text-muted);
  font-size: var(--hps-text-sm);
  max-width: 52ch;
}
.pp-store-unlock__form {
  display: flex;
  gap: var(--hps-space-2);
  flex-wrap: wrap;
}
.pp-store-unlock__form input {
  flex: 1 1 220px;
  padding: 10px 12px;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  background: var(--hps-surface);
  color: var(--hps-text);
  font-size: var(--hps-text-sm);
}
.pp-store-unlock__error {
  margin: var(--hps-space-2) 0 0;
  color: var(--hps-error);
  font-size: var(--hps-text-sm);
}

/* Appearance editor */
.pp-store-settings {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-3);
  padding: var(--hps-space-4);
}
.pp-store-settings textarea,
.pp-store-settings input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  background: var(--hps-surface);
  color: var(--hps-text);
  font: inherit;
  resize: vertical;
}
.pp-store-settings__actions {
  display: flex;
  justify-content: flex-end;
}

/* Product grid */
.pp-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--hps-space-4);
  padding: var(--hps-space-4);
}
.pp-store-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-lg);
  background: var(--hps-surface);
  overflow: hidden;
  transition: box-shadow var(--hps-transition-fast), transform var(--hps-transition-fast), border-color var(--hps-transition-fast);
}
.pp-store-card:hover {
  box-shadow: var(--hps-shadow-md);
  border-color: var(--hps-primary-light);
}
.pp-store-card.is-featured {
  border-color: var(--hps-accent);
  box-shadow: 0 0 0 1px var(--hps-accent);
}
.pp-store-card.is-hidden {
  opacity: 0.6;
}
.pp-store-card.is-dragging {
  opacity: 0.4;
  transform: scale(0.98);
}
.pp-store-card__grip {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hps-radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--hps-text-muted);
  cursor: grab;
  box-shadow: var(--hps-shadow-sm);
}
.pp-store-card__grip:active { cursor: grabbing; }
.pp-store-card__grip svg { width: 16px; height: 16px; }
.pp-store-card__move {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pp-store-movebtn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--hps-radius-sm);
  background: rgba(255, 255, 255, 0.92);
  color: var(--hps-primary);
  cursor: pointer;
  box-shadow: var(--hps-shadow-sm);
  transition: background var(--hps-transition-fast), color var(--hps-transition-fast), opacity var(--hps-transition-fast);
}
.pp-store-movebtn svg { width: 15px; height: 15px; }
.pp-store-movebtn:hover:not(:disabled) { background: var(--hps-primary); color: var(--hps-text-inverse); }
.pp-store-movebtn:disabled { opacity: 0.35; cursor: default; }
.pp-store-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--hps-surface-alt);
}
.pp-store-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pp-store-card__noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hps-text-faint);
}
.pp-store-card__noimg svg { width: 40px; height: 40px; }
.pp-store-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: var(--hps-radius-full);
  background: var(--hps-accent);
  color: var(--hps-text-inverse);
  font-size: 11px;
  font-weight: var(--hps-weight-bold);
  letter-spacing: var(--hps-tracking-wide);
  text-transform: uppercase;
}
.pp-store-card__badge--hidden {
  top: auto;
  bottom: 8px;
  right: 8px;
  background: var(--hps-text-muted);
}
.pp-store-card__body {
  padding: var(--hps-space-3);
  flex: 1;
}
.pp-store-card__cat {
  font-size: 11px;
  font-weight: var(--hps-weight-bold);
  letter-spacing: var(--hps-tracking-wide);
  text-transform: uppercase;
  color: var(--hps-primary);
  margin-bottom: 2px;
}
.pp-store-card__name {
  margin: 0 0 4px;
  font-size: var(--hps-text-base);
  font-weight: var(--hps-weight-bold);
  color: var(--hps-text);
  line-height: 1.3;
}
.pp-store-card__price {
  font-size: var(--hps-text-base);
  font-weight: var(--hps-weight-extrabold);
  color: var(--hps-text);
}
.pp-store-card__price span {
  font-size: 12px;
  font-weight: var(--hps-weight-regular);
  color: var(--hps-text-muted);
}
.pp-store-card__actions {
  display: flex;
  gap: 4px;
  padding: var(--hps-space-2) var(--hps-space-3) var(--hps-space-3);
  border-top: 1px solid var(--hps-divider);
}
.pp-store-iconbtn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  background: var(--hps-surface);
  color: var(--hps-text-muted);
  cursor: pointer;
  transition: background var(--hps-transition-fast), color var(--hps-transition-fast), border-color var(--hps-transition-fast);
}
.pp-store-iconbtn svg { width: 16px; height: 16px; }
.pp-store-iconbtn:hover {
  background: var(--hps-surface-alt);
  color: var(--hps-text);
  border-color: var(--hps-primary-light);
}
.pp-store-iconbtn.is-on {
  color: var(--hps-accent);
  border-color: var(--hps-accent);
  background: var(--hps-accent-light);
}
.pp-store-iconbtn--danger:hover {
  color: var(--hps-error);
  border-color: var(--hps-error);
}
.pp-store-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hps-space-3);
  padding: var(--hps-space-8);
  color: var(--hps-text-muted);
}

/* Photo uploader in modal */
.pp-store-uploader {
  position: relative;
  border: 2px dashed var(--hps-border);
  border-radius: var(--hps-radius-lg);
  background: var(--hps-surface-alt);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--hps-transition-fast);
}
.pp-store-uploader:hover { border-color: var(--hps-primary); }
.pp-store-uploader img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
}
.pp-store-uploader__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--hps-text-muted);
  text-align: center;
  padding: var(--hps-space-4);
}
.pp-store-uploader__placeholder svg { width: 30px; height: 30px; margin-bottom: 4px; }
.pp-store-uploader__hint { font-size: 12px; color: var(--hps-text-faint); }
.pp-store-uploader__spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  color: var(--hps-text);
  font-weight: var(--hps-weight-medium);
}
.pp-store-modal-toggles {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-2);
  margin-top: var(--hps-space-2);
}
.pp-store-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--hps-text-sm);
  color: var(--hps-text);
  cursor: pointer;
}
.pp-store-check input { margin-top: 3px; }
.pp-store-check strong { font-weight: var(--hps-weight-bold); }

/* ===== Website Gallery ===== */
.pp-gallery-drop {
  border: 2px dashed var(--hps-border);
  border-radius: var(--hps-radius-lg);
  background: var(--hps-surface-alt);
  padding: var(--hps-space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pp-gallery-drop:hover { border-color: var(--hps-primary); }
.pp-gallery-drop.is-over {
  border-color: var(--hps-primary);
  background: color-mix(in srgb, var(--hps-primary) 8%, var(--hps-surface-alt));
}
.pp-gallery-drop svg { width: 34px; height: 34px; color: var(--hps-primary); }
.pp-gallery-drop__title {
  font-weight: var(--hps-weight-bold);
  color: var(--hps-text);
  font-size: var(--hps-text-base);
}
.pp-gallery-drop__hint {
  font-size: var(--hps-text-sm);
  color: var(--hps-text-muted);
  max-width: 46ch;
  line-height: 1.5;
}
.pp-gallery-drop__progress {
  margin-top: 4px;
  font-size: var(--hps-text-sm);
  font-weight: var(--hps-weight-medium);
  color: var(--hps-primary);
}
.pp-gallery-modal__preview {
  border-radius: var(--hps-radius-lg);
  overflow: hidden;
  background: var(--hps-surface-alt);
  margin-bottom: var(--hps-space-3);
}
.pp-gallery-modal__preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

/* -- Visit completion panel -- */
.pp-visit-done {
  text-align: center;
}
.pp-visit-done__check {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(67, 122, 34, 0.12);
  color: var(--hps-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 12px;
}
.pp-visit-done__title {
  font-family: var(--hps-font-display, inherit);
  font-size: var(--hps-text-xl);
  color: var(--hps-text);
  margin: 0 0 6px;
}
.pp-visit-done__msg {
  color: var(--hps-text-muted);
  font-size: var(--hps-text-sm);
  line-height: 1.5;
  max-width: 460px;
  margin: 0 auto 18px;
}
.pp-visit-done__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hps-space-2);
  justify-content: center;
}
.pp-done-textcheck {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  border: 1px solid var(--hps-border);
  border-radius: 10px;
  background: var(--hps-surface-2, var(--hps-surface));
  color: var(--hps-text);
  font-size: var(--hps-text-sm);
  font-weight: 600;
  cursor: pointer;
}
.pp-done-textcheck input {
  width: 18px;
  height: 18px;
  accent-color: var(--hps-gold, #D6B25E);
  cursor: pointer;
}

/* ===================================================
   MORNING COMMAND CENTER (Dashboard)
   =================================================== */

/* Owner command center */
.pp-owner-command { display: none; margin-bottom: var(--hps-space-6); }
#view-pp-dashboard.is-owner-loaded > .pp-quick,
#view-pp-dashboard.is-owner-loaded > .pp-dash-section { display: none; }
#view-pp-dashboard.is-owner-loaded .pp-owner-command { display: block; }
.pp-owner-topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--hps-space-4); padding: var(--hps-space-4); margin-bottom: var(--hps-space-4); border: 1px solid var(--hps-border); border-radius: var(--hps-radius-lg); background: var(--hps-surface); }
.pp-owner-eyebrow, .pp-owner-sectionhead span { display: block; color: var(--hps-accent-hover); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.pp-owner-asof { margin: 3px 0 0; color: var(--hps-text-muted); font-size: 12px; }
.pp-owner-actions { display: flex; align-items: center; gap: var(--hps-space-2); }
#pp-owner-dashboard { display: flex; flex-direction: column; gap: var(--hps-space-5); }
#pp-owner-dashboard > section, .pp-owner-panel { padding: var(--hps-space-5); border: 1px solid var(--hps-border); border-radius: var(--hps-radius-lg); background: var(--hps-surface); box-shadow: var(--hps-shadow-sm); }
.pp-owner-priority { border-top: 4px solid var(--hps-warning) !important; }
.pp-owner-sectionhead { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--hps-space-3); margin-bottom: var(--hps-space-4); }
.pp-owner-sectionhead h2 { margin: 2px 0 0; color: var(--hps-primary); font-family: var(--hps-font-heading); font-size: 1.1rem; line-height: 1.25; }
.pp-owner-sectionhead > strong { min-width: 72px; color: var(--hps-warning); font-size: 12px; text-align: right; }
.pp-owner-link { padding: 2px 0; border: 0; background: none; color: var(--hps-primary); font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.pp-owner-link:hover { color: var(--hps-accent-hover); }
.pp-owner-alerts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--hps-space-2); }
.pp-owner-alert { display: flex; align-items: center; gap: var(--hps-space-3); padding: var(--hps-space-3); border: 1px solid var(--hps-border); border-radius: var(--hps-radius-md); background: var(--hps-surface); color: var(--hps-text); text-align: left; cursor: pointer; }
.pp-owner-alert:hover { border-color: var(--hps-warning); }
.pp-owner-alert > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.pp-owner-alert small, .pp-owner-activity small { color: var(--hps-text-muted); font-size: 12px; line-height: 1.4; }
.pp-owner-alert__dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--hps-warning); }
.pp-owner-alert.is-high .pp-owner-alert__dot { background: var(--hps-error); }
.pp-owner-clear { display: flex; grid-column: 1 / -1; flex-direction: column; gap: 3px; padding: var(--hps-space-5); border-radius: var(--hps-radius-md); background: var(--hps-surface-alt); color: var(--hps-success); text-align: center; }
.pp-owner-clear span { color: var(--hps-text-muted); font-size: 12px; }
.pp-owner-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--hps-border); border-radius: var(--hps-radius-md); overflow: hidden; }
.pp-owner-metric { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: var(--hps-space-4); border: 0; border-right: 1px solid var(--hps-border); background: var(--hps-surface); color: var(--hps-text); text-align: left; cursor: pointer; }
.pp-owner-metric:last-child { border-right: 0; }
.pp-owner-metric:hover { background: var(--hps-surface-alt); }
.pp-owner-metric__label, .pp-owner-metric > span:last-child { color: var(--hps-text-muted); font-size: 11px; line-height: 1.35; }
.pp-owner-metric strong { color: var(--hps-primary); font-family: var(--hps-font-heading); font-size: clamp(1.3rem, 2vw, 1.8rem); }
.pp-owner-metric.is-risk strong { color: var(--hps-error); }
.pp-owner-metric.is-good strong { color: var(--hps-success); }
.pp-owner-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: var(--hps-space-4); }
.pp-owner-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pp-owner-progress { display: flex; flex-direction: column; gap: var(--hps-space-3); }
.pp-owner-progress > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: var(--hps-space-2); }
.pp-owner-progress strong, .pp-owner-bigstat strong, .pp-owner-team strong { color: var(--hps-primary); font-family: var(--hps-font-heading); font-size: 2rem; }
.pp-owner-progress span, .pp-owner-bigstat span, .pp-owner-team span { color: var(--hps-text-muted); font-size: 12px; }
.pp-owner-track { height: 9px; overflow: hidden; border-radius: 999px; background: var(--hps-surface-alt); }
.pp-owner-track span { display: block; height: 100%; border-radius: inherit; background: var(--hps-success); }
.pp-owner-facts { display: flex; flex-wrap: wrap; gap: var(--hps-space-3); margin-top: var(--hps-space-4); }
.pp-owner-facts span { display: flex; flex-direction: column; gap: 2px; min-width: 90px; color: var(--hps-text-muted); font-size: 11px; }
.pp-owner-facts strong { color: var(--hps-text); font-size: 14px; }
.pp-owner-stages { display: flex; flex-wrap: wrap; gap: var(--hps-space-2); margin-top: var(--hps-space-4); }
.pp-owner-stage { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: var(--hps-surface-alt); color: var(--hps-text-muted); font-size: 10px; text-transform: capitalize; }
.pp-owner-stage strong { color: var(--hps-primary); }
.pp-owner-team, .pp-owner-bigstat { display: flex; align-items: baseline; gap: var(--hps-space-2); }
.pp-owner-activitylist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--hps-space-4); }
.pp-owner-activity { display: flex; align-items: center; justify-content: space-between; gap: var(--hps-space-3); padding: var(--hps-space-3) 0; border: 0; border-bottom: 1px solid var(--hps-border); background: none; color: var(--hps-text); text-align: left; cursor: pointer; }
.pp-owner-activity > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pp-owner-activity time { flex: 0 0 auto; color: var(--hps-text-muted); font-size: 11px; }
.pp-owner-loading, .pp-owner-error { display: flex; min-height: 260px; align-items: center; justify-content: center; flex-direction: column; gap: var(--hps-space-3); border: 1px dashed var(--hps-border); border-radius: var(--hps-radius-lg); color: var(--hps-text-muted); text-align: center; }
.pp-owner-error strong { color: var(--hps-text); }
.pp-owner-empty { color: var(--hps-text-muted); font-size: 12px; }
.pp-owner-alert:focus-visible, .pp-owner-metric:focus-visible, .pp-owner-activity:focus-visible, .pp-owner-link:focus-visible { outline: 2px solid var(--hps-accent); outline-offset: 2px; }
@media (max-width: 900px) { .pp-owner-metrics, .pp-owner-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pp-owner-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .pp-owner-topbar, .pp-owner-sectionhead { align-items: flex-start; flex-direction: column; } .pp-owner-actions { width: 100%; } .pp-owner-actions .portal-btn { flex: 1; } .pp-owner-alerts, .pp-owner-metrics, .pp-owner-grid--three, .pp-owner-activitylist { grid-template-columns: 1fr; } .pp-owner-metric { border-right: 0; border-bottom: 1px solid var(--hps-border); } .pp-owner-metric:last-child { border-bottom: 0; } #pp-owner-dashboard > section, .pp-owner-panel { padding: var(--hps-space-4); } }

/* Attention Required — the most prominent decision surface */
.pp-attention {
  border: 1px solid rgba(150, 66, 25, 0.35);
  border-left: 4px solid var(--hps-warning, #964219);
  background:
    linear-gradient(180deg, rgba(150, 66, 25, 0.05), transparent 120px),
    var(--hps-surface, #fff);
}
.pp-attention--clear {
  border-color: var(--hps-border);
  border-left-color: var(--hps-success, #437a22);
  background: var(--hps-surface, #fff);
}
.pp-attention__header {
  flex-wrap: wrap;
  gap: var(--hps-space-1) var(--hps-space-3);
}
.pp-attention__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: var(--hps-space-2);
  border-radius: 11px;
  background: var(--hps-warning, #964219);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}
.pp-attention__hint {
  flex-basis: 100%;
  font-size: var(--hps-text-sm);
  color: var(--hps-text-muted);
  font-weight: 500;
}
.pp-attention__list {
  display: flex;
  flex-direction: column;
  gap: var(--hps-space-2);
  margin-top: var(--hps-space-3);
}
.pp-attention__clear {
  padding: var(--hps-space-5);
  text-align: center;
  color: var(--hps-text-muted);
  font-size: var(--hps-text-sm);
}

/* Attention row */
.pp-att-row {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  width: 100%;
  text-align: left;
  padding: var(--hps-space-3);
  border: 1px solid var(--hps-border);
  border-left: 3px solid var(--hps-text-muted);
  border-radius: var(--hps-radius-md);
  background: var(--hps-surface, #fff);
  cursor: pointer;
  transition: var(--hps-transition, all 0.15s ease);
}
.pp-att-row:hover { box-shadow: var(--hps-shadow-sm); transform: translateX(2px); }
.pp-att-row--high { border-left-color: var(--hps-error, #a12c7b); }
.pp-att-row--med { border-left-color: var(--hps-warning, #964219); }
.pp-att-row__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.pp-att-row__icon svg { width: 18px; height: 18px; }
.pp-att-row--high .pp-att-row__icon { background: rgba(161, 44, 123, 0.12); color: var(--hps-error, #a12c7b); }
.pp-att-row--med .pp-att-row__icon { background: rgba(150, 66, 25, 0.12); color: var(--hps-warning, #964219); }
.pp-att-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-att-row__title {
  font-weight: 700;
  font-size: var(--hps-text-sm);
  color: var(--hps-text);
}
.pp-att-row__meta {
  font-size: 12px;
  color: var(--hps-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pp-att-row__tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.pp-att-row__tag--high { background: rgba(161, 44, 123, 0.12); color: var(--hps-error, #a12c7b); }
.pp-att-row__tag--med { background: rgba(150, 66, 25, 0.12); color: var(--hps-warning, #964219); }

/* Generic mini-list used by the decision cards */
.pp-mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--hps-space-2);
}
.pp-mini-summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--hps-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-bottom: var(--hps-space-1);
}
.pp-mini-row {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  width: 100%;
  text-align: left;
  padding: 10px var(--hps-space-3);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  background: var(--hps-surface, #fff);
  cursor: pointer;
  transition: var(--hps-transition, all 0.15s ease);
}
.pp-mini-row:hover { border-color: var(--hps-accent); background: var(--hps-surface-alt, rgba(0,0,0,0.02)); }
.pp-mini-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-mini-row__title { font-weight: 600; font-size: var(--hps-text-sm); color: var(--hps-text); }
.pp-mini-row__meta {
  font-size: 12px;
  color: var(--hps-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pp-mini-row__val { flex-shrink: 0; font-weight: 800; font-size: var(--hps-text-sm); }
.pp-mini-row__val--bad { color: var(--hps-error, #a12c7b); }
.pp-mini-row__val--warn { color: var(--hps-warning, #964219); }
.pp-mini-more {
  align-self: flex-start;
  margin-top: 2px;
  background: none;
  border: none;
  padding: 4px 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hps-primary);
  cursor: pointer;
}
.pp-mini-more:hover { text-decoration: underline; }
.pp-mini-empty {
  padding: var(--hps-space-5);
  text-align: center;
  color: var(--hps-text-muted);
  font-size: var(--hps-text-sm);
}

/* ===================================================
   CUSTOMER FORM — Pool & Equipment section
   =================================================== */
.pp-form-section {
  margin-top: var(--hps-space-3);
  padding: var(--hps-space-4);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  background: var(--hps-surface-alt, rgba(0, 0, 0, 0.02));
}
.pp-form-section__head {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hps-primary);
  margin-bottom: var(--hps-space-3);
}
.pp-form-hintfield { display: flex; align-items: flex-end; }
.pp-form-hint {
  font-size: 12px;
  color: var(--hps-text-muted);
  line-height: 1.4;
}

/* ===================================================
   CUSTOMER DETAIL — photos + history
   =================================================== */
.pp-detail-notes {
  margin-top: var(--hps-space-3);
  padding: var(--hps-space-3);
  border-left: 3px solid var(--hps-accent, var(--hps-primary));
  background: var(--hps-surface-alt, rgba(0, 0, 0, 0.02));
  border-radius: 0 var(--hps-radius-md) var(--hps-radius-md) 0;
  font-size: var(--hps-text-sm);
  color: var(--hps-text);
  line-height: 1.5;
}
.pp-detail-empty {
  color: var(--hps-text-muted);
  font-size: var(--hps-text-sm);
  padding: var(--hps-space-2) 0;
}

.pp-cust-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--hps-space-2);
  margin-bottom: var(--hps-space-3);
}
.pp-cust-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--hps-radius-md);
  overflow: hidden;
  border: 1px solid var(--hps-border);
  background: var(--hps-surface-alt, rgba(0, 0, 0, 0.03));
}
.pp-cust-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-cust-photo__del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.pp-cust-photo__del:hover { background: var(--hps-error, #a12c7b); }
.pp-cust-photo-actions {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  flex-wrap: wrap;
}
.pp-cust-photo-status { font-size: 12px; color: var(--hps-text-muted); font-weight: 600; }

.pp-hist-scroll {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
}
.pp-hist-table { width: 100%; border-collapse: collapse; font-size: var(--hps-text-sm); }
.pp-hist-table th {
  position: sticky;
  top: 0;
  background: var(--hps-surface-alt, #f4f4f4);
  color: var(--hps-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hps-border);
}
.pp-hist-table td { padding: 8px 10px; border-bottom: 1px solid var(--hps-border); color: var(--hps-text); }
.pp-hist-table tbody tr:last-child td { border-bottom: none; }

.pp-hist-list { display: flex; flex-direction: column; gap: var(--hps-space-2); }
.pp-hist-item {
  padding: var(--hps-space-3);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  background: var(--hps-surface, #fff);
}
.pp-hist-item__top { display: flex; align-items: center; justify-content: space-between; gap: var(--hps-space-2); margin-bottom: 4px; }
.pp-hist-item__top strong { font-size: var(--hps-text-sm); color: var(--hps-text); }
.pp-hist-item__tech { font-size: 12px; color: var(--hps-text-muted); }
.pp-hist-item__sum { font-size: var(--hps-text-sm); color: var(--hps-text-muted); line-height: 1.45; }

/* ============================================================
   REIMAGINED DASHBOARD — quick actions, sections & charts
   ============================================================ */

/* Quick actions bar */
.pp-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--hps-space-3);
  margin-bottom: var(--hps-space-6);
}
.pp-quick__btn {
  display: flex;
  align-items: center;
  gap: var(--hps-space-3);
  padding: var(--hps-space-3) var(--hps-space-4);
  background: var(--hps-surface, #fff);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-lg, 12px);
  cursor: pointer;
  text-align: left;
  transition: var(--hps-transition);
  box-shadow: var(--hps-shadow-sm);
}
.pp-quick__btn:hover {
  border-color: var(--hps-accent);
  box-shadow: var(--hps-shadow-md);
  transform: translateY(-1px);
}
.pp-quick__btn:focus-visible { outline: 2px solid var(--hps-accent); outline-offset: 2px; }
.pp-quick__ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--hps-radius-md);
  background: var(--hps-primary);
  color: #fff;
}
.pp-quick__ic svg { width: 19px; height: 19px; }
.pp-quick__lbl { font-size: var(--hps-text-sm); font-weight: 700; color: var(--hps-text); line-height: 1.25; }

/* Dashboard sections */
.pp-dash-section { margin-bottom: var(--hps-space-8); }
.pp-dash-section__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--hps-space-2) var(--hps-space-3);
  padding-bottom: var(--hps-space-3);
  margin-bottom: var(--hps-space-4);
  border-bottom: 2px solid var(--hps-border);
}
.pp-dash-section__title {
  font-family: var(--hps-font-heading, inherit);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hps-primary);
  margin: 0;
  letter-spacing: -0.01em;
}
.pp-dash-section__hint { font-size: var(--hps-text-sm); color: var(--hps-text-muted); }

/* Charts grid */
.pp-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--hps-space-4);
  margin-top: var(--hps-space-4);
}
.pp-chart-panel { display: flex; flex-direction: column; }
.pp-chart { padding-top: var(--hps-space-2); min-height: 150px; }
.pp-chart__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  color: var(--hps-text-muted);
  font-size: var(--hps-text-sm);
  text-align: center;
}

/* Horizontal bars (revenue by plan) */
.pp-bars { display: flex; flex-direction: column; gap: var(--hps-space-3); }
.pp-bars__row {
  display: grid;
  grid-template-columns: minmax(96px, 40%) 1fr auto;
  align-items: center;
  gap: var(--hps-space-3);
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.pp-bars__row:hover .pp-bars__fill { filter: brightness(1.06); }
.pp-bars__row:hover .pp-bars__label { color: var(--hps-accent-hover); }
.pp-bars__label { font-size: var(--hps-text-sm); font-weight: 600; color: var(--hps-text); display: flex; align-items: center; gap: 6px; }
.pp-bars__meta {
  font-size: 11px;
  font-weight: 700;
  color: var(--hps-text-muted);
  background: var(--hps-surface-alt, #f1f1f1);
  border-radius: 999px;
  padding: 1px 7px;
}
.pp-bars__track { height: 12px; background: var(--hps-surface-alt, #eee); border-radius: 999px; overflow: hidden; }
.pp-bars__fill { display: block; height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.22,.61,.36,1); }
.pp-bars__fill--plan-a { background: var(--hps-primary); }
.pp-bars__fill--plan-b { background: var(--hps-accent); }
.pp-bars__fill--plan-c { background: var(--hps-success); }
.pp-bars__fill--plan-d { background: var(--hps-warning); }
.pp-bars__val { font-size: var(--hps-text-sm); font-weight: 800; color: var(--hps-text); white-space: nowrap; }

/* Sparkline / area (customer growth) */
.pp-spark__head { display: flex; align-items: baseline; gap: var(--hps-space-3); margin-bottom: var(--hps-space-2); }
.pp-spark__big { font-size: 1.9rem; font-weight: 800; color: var(--hps-primary); line-height: 1; }
.pp-spark__delta { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pp-spark__delta.is-up { color: var(--hps-success); background: rgba(42,157,92,.12); }
.pp-spark__delta.is-down { color: var(--hps-warning); background: rgba(232,148,26,.12); }
.pp-spark { width: 100%; height: 110px; display: block; overflow: visible; }
.pp-spark__area { fill: rgba(10,35,66,.10); stroke: none; }
.pp-spark__line { fill: none; stroke: var(--hps-primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pp-spark__dot { fill: #fff; stroke: var(--hps-accent-hover); stroke-width: 2; }
.pp-spark__labels { display: flex; justify-content: space-between; margin-top: 6px; }
.pp-spark__labels span { font-size: 11px; color: var(--hps-text-muted); font-weight: 600; }

/* Columns (visits completed) */
.pp-cols { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--hps-space-2); height: 150px; }
.pp-cols__col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  height: 100%;
}
.pp-cols__bar-wrap { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; width: 100%; flex: 1; }
.pp-cols__num { font-size: 11px; font-weight: 800; color: var(--hps-text); margin-bottom: 3px; }
.pp-cols__bar {
  width: 70%;
  max-width: 26px;
  min-height: 3px;
  background: var(--hps-primary);
  border-radius: 4px 4px 0 0;
  transition: height .5s cubic-bezier(.22,.61,.36,1), background .15s ease;
}
.pp-cols__col:hover .pp-cols__bar { background: var(--hps-accent-hover); }
.pp-cols__label { font-size: 10px; color: var(--hps-text-muted); font-weight: 600; white-space: nowrap; }

@media (max-width: 600px) {
  .pp-quick { grid-template-columns: repeat(2, 1fr); }
  .pp-dash-section__head { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ============================================================
   PROMOTIONS EDITOR (Pool Pro portal)
   ============================================================ */
.pp-promo-intro { color: var(--hps-text-muted); font-size: var(--hps-text-sm); line-height: 1.5; }
.pp-promo-intro p { margin: 0; }

.pp-promo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--hps-space-4);
  margin: var(--hps-space-4) 0;
}
.pp-promo-card {
  background: var(--hps-surface);
  border: 1px solid var(--hps-border);
  border-radius: var(--hps-radius-md);
  padding: var(--hps-space-4);
  box-shadow: var(--hps-shadow-sm);
  transition: var(--hps-transition);
}
.pp-promo-card.is-off { opacity: .62; border-style: dashed; }
.pp-promo-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--hps-space-3); }
.pp-promo-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: var(--hps-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--hps-primary); cursor: pointer; }
.pp-promo-toggle input { width: 16px; height: 16px; accent-color: var(--hps-primary); cursor: pointer; }
.pp-promo-del {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--hps-radius-sm);
  background: none; border: 1px solid var(--hps-border); color: var(--hps-error, #A12C7B);
  cursor: pointer; transition: var(--hps-transition);
}
.pp-promo-del:hover { background: rgba(161, 44, 123, 0.08); border-color: var(--hps-error, #A12C7B); }
.pp-promo-del svg { width: 16px; height: 16px; }
.pp-promo-card .portal-form__field { margin-bottom: var(--hps-space-3); }
.pp-promo-card .portal-form__field:last-child { margin-bottom: 0; }
.pp-promo-code input { max-width: 220px; text-transform: uppercase; letter-spacing: .04em; }

.pp-promo-empty {
  grid-column: 1 / -1;
  text-align: center; padding: var(--hps-space-6) var(--hps-space-4);
  color: var(--hps-text-muted); display: flex; flex-direction: column; align-items: center; gap: var(--hps-space-3);
}
.pp-promo-empty p { margin: 0; }

.pp-promo-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--hps-space-4); margin-top: var(--hps-space-2); }
.pp-promo-actions__status { font-size: var(--hps-text-sm); color: var(--hps-text-muted); }
.pp-promo-actions__status.is-ok { color: var(--hps-success); font-weight: 600; }
.pp-promo-actions__status.is-err { color: var(--hps-error, #A12C7B); font-weight: 600; }

/* Brand + image controls */
.pp-promo-row { display: flex; gap: var(--hps-space-3); }
.pp-promo-row .portal-form__field { flex: 1 1 0; margin-bottom: var(--hps-space-3); }
.pp-promo-card select {
  width: 100%; box-sizing: border-box; padding: 9px 10px;
  border: 1px solid var(--hps-border); border-radius: var(--hps-radius-sm);
  background: var(--hps-surface); color: var(--hps-text); font: inherit; font-size: var(--hps-text-sm);
}
.pp-promo-imgrow { display: flex; align-items: center; gap: var(--hps-space-3); }
.pp-promo-thumb {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: var(--hps-radius-sm); border: 1px solid var(--hps-border);
}
.pp-promo-imgclear { flex: 0 0 auto; }
@media (max-width: 480px) { .pp-promo-row { flex-direction: column; gap: 0; } }

/* ============================================
   Forms & Agreements (admin)
   ============================================ */
.pp-forms-rules { display: flex; flex-direction: column; gap: var(--hps-space-2); margin-bottom: var(--hps-space-4); }
.pp-forms-rule { display: flex; gap: 10px; align-items: flex-start; font-size: var(--hps-text-sm); color: var(--hps-text); line-height: 1.5; }
.pp-forms-rule strong { color: var(--hps-primary); }
.pp-forms-rule em { font-style: normal; font-weight: 600; }
.pp-forms-rule__dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--hps-accent, #f2b705); margin-top: 6px; }

.pp-forms-search {
  padding: 8px 12px; border: 1px solid var(--hps-border); border-radius: var(--hps-radius-md);
  font: inherit; font-size: var(--hps-text-sm); color: var(--hps-text); background: var(--hps-surface); min-width: 200px;
}
.pp-forms-search:focus { outline: none; border-color: var(--hps-primary); }

.pp-forms-table { display: flex; flex-direction: column; }
.pp-forms-row {
  display: flex; align-items: center; gap: var(--hps-space-4); flex-wrap: wrap;
  padding: var(--hps-space-4) 0; border-bottom: 1px solid var(--hps-border);
}
.pp-forms-row:last-child { border-bottom: none; }
.pp-forms-row__cust { display: flex; flex-direction: column; gap: 2px; min-width: 180px; flex: 1 1 180px; }
.pp-forms-row__name { font-family: var(--hps-font-heading); font-weight: 700; color: var(--hps-text); font-size: var(--hps-text-sm); }
.pp-forms-row__email { font-size: var(--hps-text-xs); color: var(--hps-text-muted); }
.pp-forms-newtag { display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 800; letter-spacing: 0.06em; color: #fff; background: var(--hps-primary); padding: 1px 6px; border-radius: 100px; vertical-align: middle; }
.pp-forms-row__chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 2 1 300px; }
.pp-form-chip {
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 100px;
  border: 1px solid transparent; cursor: default; font-family: inherit; line-height: 1.2;
}
.pp-form-chip.is-done { background: rgba(47,133,90,0.12); color: var(--hps-success, #2f855a); cursor: pointer; }
.pp-form-chip.is-required { background: rgba(178,106,0,0.14); color: var(--hps-warning, #b26a00); }
.pp-form-chip.is-required[onclick] { cursor: pointer; }
.pp-form-chip.is-available { background: var(--hps-surface-alt); color: var(--hps-text-muted); }
.pp-form-chip[onclick]:hover { filter: brightness(0.95); }
.pp-forms-row__status { min-width: 110px; text-align: right; flex: 0 0 auto; }
.pp-forms-out { font-size: var(--hps-text-xs); font-weight: 700; color: var(--hps-warning, #b26a00); }
.pp-forms-clear { font-size: var(--hps-text-xs); font-weight: 600; color: var(--hps-success, #2f855a); }
.pp-forms-assign-hint { font-size: var(--hps-text-xs); color: var(--hps-text-muted); line-height: 1.5; margin: var(--hps-space-2) 0 var(--hps-space-3); }
.pp-modal__card--wide { max-width: 760px; }
@media (max-width: 640px) {
  .pp-forms-row__status { text-align: left; min-width: 0; }
}

/* ============================================================
   FIELD-SERVICE UX: bottom nav, More sheet, status badges,
   customer summary hero, expandable sections, sticky actions
   ============================================================ */

/* ---- Unified status badges ---- */
.pp-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pp-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.pp-status--scheduled { background: #e8f0fb; color: #1d4e94; border-color: #c4d8f2; }
.pp-status--progress { background: #e6f5fb; color: #086388; border-color: #bfe4f2; }
.pp-status--done { background: #e8f6ee; color: #1e6b41; border-color: #c2e5d1; }
.pp-status--followup { background: #fdf3e0; color: #8a5a00; border-color: #f0dcae; }
.pp-status--pastdue { background: #fdeaea; color: #a02020; border-color: #f2c7c7; }
.pp-status--alert { background: #fdeee4; color: #99420a; border-color: #f2d3bc; }
.pp-status--neutral { background: var(--hps-surface-alt, #f1f4f8); color: var(--hps-text-muted, #5a6a7a); border-color: var(--hps-border, #dde4ec); }

/* ---- Mobile bottom navigation ---- */
.pp-bottomnav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 240;
  background: var(--hps-primary, #0a2342);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.pp-bottomnav__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 2px 7px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}
.pp-bottomnav__item svg { width: 22px; height: 22px; flex: 0 0 auto; }
.pp-bottomnav__item.is-active { color: #fff; }
.pp-bottomnav__item.is-active svg { color: var(--hps-accent, #d6b25e); }
.pp-bottomnav__item:focus-visible { outline: 2px solid var(--hps-accent, #d6b25e); outline-offset: -2px; border-radius: 8px; }

/* ---- More sheet (slide-up) ---- */
.pp-more-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 250;
}
.pp-more-sheet.is-open { display: block; }
.pp-more-sheet__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 46, 0.5);
  border: none;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.pp-more-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--hps-surface, #fff);
  border-radius: 16px 16px 0 0;
  max-height: 75vh;
  overflow-y: auto;
  padding: 10px 14px calc(16px + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -8px 30px rgba(10, 25, 46, 0.25);
  animation: pp-sheet-up 0.22s ease;
}
@keyframes pp-sheet-up {
  from { transform: translateY(30%); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }
}
.pp-more-sheet__handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--hps-border, #dde4ec);
  margin: 2px auto 10px;
}
.pp-more-sheet__title {
  font-family: var(--hps-font-heading);
  font-size: 16px;
  font-weight: 800;
  color: var(--hps-primary, #0a2342);
  margin: 0 4px 4px;
}
.pp-more-sheet__section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hps-text-muted, #5a6a7a);
  margin: 12px 4px 6px;
}
.pp-more-sheet__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pp-more-sheet__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 68px;
  padding: 10px 6px;
  border: 1px solid var(--hps-border, #dde4ec);
  border-radius: 10px;
  background: var(--hps-surface-alt, #f7f9fc);
  color: var(--hps-text, #16283c);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--hps-font-body);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  line-height: 1.3;
}
.pp-more-sheet__item svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--hps-primary, #0a2342); }
.pp-more-sheet__item:active { background: var(--hps-border, #dde4ec); }
.pp-more-sheet__footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--hps-border, #dde4ec);
  display: flex;
  justify-content: center;
}

/* ---- Customer detail: summary-first hero ---- */
.pp-detail-hero {
  background: var(--hps-surface-alt, #f7f9fc);
  border: 1px solid var(--hps-border, #dde4ec);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pp-detail-hero__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-detail-hero__contact { display: flex; flex-direction: column; gap: 8px; }
.pp-detail-hero__link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--hps-primary, #0a2342);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  min-height: 32px;
  word-break: break-word;
}
.pp-detail-hero__link svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--hps-text-muted, #5a6a7a); }
.pp-detail-hero__link:hover { text-decoration: underline; }
.pp-detail-hero__access {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #fdf3e0;
  border: 1px solid #f0dcae;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #6d4a00;
}
.pp-detail-hero__access strong { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: #8a5a00; }
.pp-detail-hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.pp-detail-hero__facts > div {
  background: var(--hps-surface, #fff);
  border: 1px solid var(--hps-border, #dde4ec);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pp-detail-hero__facts span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--hps-text-muted, #5a6a7a); }
.pp-detail-hero__facts strong { font-size: 14px; color: var(--hps-text, #16283c); line-height: 1.35; }
.pp-detail-hero__issues {
  margin: 0;
  padding: 0 0 0 2px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pp-detail-hero__issues li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #a02020;
}
.pp-detail-hero__issues li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d64545;
  flex: 0 0 auto;
}

/* ---- Expandable detail sections ---- */
.pp-detail-acc {
  border: 1px solid var(--hps-border, #dde4ec);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--hps-surface, #fff);
  overflow: hidden;
}
.pp-detail-acc > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--hps-text, #16283c);
  cursor: pointer;
  min-height: 46px;
  -webkit-tap-highlight-color: transparent;
}
.pp-detail-acc > summary::-webkit-details-marker { display: none; }
.pp-detail-acc > summary::after {
  content: '';
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--hps-text-muted, #5a6a7a);
  border-bottom: 2px solid var(--hps-text-muted, #5a6a7a);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex: 0 0 auto;
  margin-right: 3px;
}
.pp-detail-acc[open] > summary::after { transform: rotate(225deg); }
.pp-detail-acc[open] > summary { border-bottom: 1px solid var(--hps-border, #dde4ec); }
.pp-detail-acc__body { padding: 13px 14px; }

/* ---- Prominent Start Service Visit on route stops ---- */
.pp-mini-btn--start {
  background: var(--hps-primary, #0a2342);
  color: #fff;
  border-color: var(--hps-primary, #0a2342);
  font-weight: 700;
  padding: 9px 16px;
  min-height: 40px;
}
.pp-mini-btn--start:hover { filter: brightness(1.2); background: var(--hps-primary, #0a2342); color: #fff; }

/* ---- Mobile field ergonomics ---- */
@media (max-width: 768px) {
  .pp-bottomnav { display: flex; }
  /* Make room for the fixed bottom nav */
  .portal-content { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0)) !important; }

  /* Sticky Complete Visit bar on the visit form */
  #view-pp-visits.is-active .pp-visit-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0));
    z-index: 230;
    background: var(--hps-surface, #fff);
    border-top: 1px solid var(--hps-border, #dde4ec);
    box-shadow: 0 -4px 16px rgba(10, 25, 46, 0.12);
    padding: 10px 14px;
    margin: 0;
    display: flex;
    gap: 10px;
  }
  #view-pp-visits.is-active .pp-visit-actions .portal-btn--primary {
    flex: 1 1 auto;
    min-height: 50px;
    font-size: 16px;
    font-weight: 700;
  }
  #view-pp-visits.is-active { padding-bottom: 90px; }

  /* Bigger tap targets for field use */
  .pp-mini-btn { min-height: 42px; padding: 9px 14px; font-size: 13.5px; }
  .pp-route-stop__actions { gap: 8px; flex-wrap: wrap; }
  .pp-detail-hero__link { min-height: 40px; }
  .portal-btn { min-height: 44px; }
}
@media (min-width: 769px) {
  .pp-bottomnav, .pp-more-sheet { display: none !important; }
}
