:root{
  --blue:#0877bd;
  --deep:#06466f;
  --aqua:#13b8c6;
  --bg:#f4f9fc;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#dceaf2;
  --green:#16a34a;
  --warn:#d97706;
  --red:#dc2626;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Tahoma,Arial,sans-serif;
  background:linear-gradient(160deg,#eaf8ff,#f7fbff);
  color:var(--text);
}
.hidden{display:none!important}
.login-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  position:relative;
  overflow:hidden;
  background:linear-gradient(135deg,#063e66,#0d9dcc);
}
.hero-bg{
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,.26), transparent 25%),
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 26%),
    linear-gradient(135deg,rgba(8,119,189,.92),rgba(19,184,198,.9));
}
.login-card{
  position:relative;
  width:min(500px,100%);
  background:rgba(255,255,255,.94);
  border:1px solid rgba(255,255,255,.55);
  border-radius:32px;
  padding:28px;
  box-shadow:0 30px 80px rgba(0,0,0,.22);
  backdrop-filter:blur(14px);
}
.brand{text-align:center;margin-bottom:10px}
.brand img{max-width:170px;max-height:110px;object-fit:contain}
.brand p{margin:6px 0 0;color:var(--muted);font-weight:700}
.hero-copy{text-align:center}
.hero-copy span{
  display:inline-block;
  color:var(--blue);
  background:#e9f8ff;
  border:1px solid var(--border);
  padding:7px 12px;
  border-radius:999px;
  font-weight:800;
}
.hero-copy h1{margin:14px 0 8px;color:var(--deep);font-size:30px;line-height:1.35}
.hero-copy p{margin:0;color:var(--muted);line-height:1.8}
.login-box{margin-top:22px}
label{display:block;margin:14px 0 8px;font-weight:800;color:var(--deep)}
input{
  width:100%;
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  font-size:16px;
  font-family:inherit;
  outline:none;
  background:#fff;
}
input:focus{border-color:var(--blue);box-shadow:0 0 0 4px rgba(8,119,189,.12)}
button{
  border:0;
  border-radius:18px;
  padding:15px 18px;
  background:linear-gradient(135deg,var(--blue),var(--deep));
  color:white;
  font-weight:900;
  cursor:pointer;
  font-family:inherit;
}
.login-box button{width:100%;margin-top:14px}
#loginMsg{display:block;text-align:center;margin-top:12px;color:var(--red);font-weight:700}
.app{max-width:1120px;margin:auto;padding:18px}
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(10px);
  border:1px solid var(--border);
  border-radius:26px;
  padding:12px 15px;
  position:sticky;
  top:12px;
  z-index:5;
}
.top-brand{display:flex;align-items:center;gap:12px}
.top-brand img{width:58px;height:58px;object-fit:contain}
.top-brand strong{display:block;color:var(--deep);font-size:20px}
.top-brand span{color:var(--muted);font-size:13px}
.ghost{background:#eef7fb;color:var(--deep)}
.welcome-hero{
  margin:18px 0;
  padding:26px;
  border-radius:32px;
  background:linear-gradient(135deg,#0877bd,#13b8c6);
  color:white;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  box-shadow:0 18px 35px rgba(8,119,189,.2);
}
.welcome-hero p,.welcome-hero h2{margin:0}
.welcome-hero h2{font-size:31px;margin:8px 0 14px}
.status-pill{
  display:inline-block;
  background:rgba(255,255,255,.18);
  border:1px solid rgba(255,255,255,.35);
  padding:10px 14px;
  border-radius:999px;
  font-weight:900;
}
.big-health{
  min-width:170px;
  background:rgba(255,255,255,.17);
  border:1px solid rgba(255,255,255,.35);
  border-radius:28px;
  padding:20px;
  text-align:center;
}
.big-health strong{display:block;font-size:44px}
.big-health span{display:block;line-height:1.6}
.cards{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}
.card,.panel{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:26px;
  padding:18px;
  box-shadow:0 10px 25px rgba(15,23,42,.05);
}
.card span{display:block;color:var(--muted);margin-bottom:8px}
.card strong{font-size:28px;color:var(--deep)}
.card p{color:var(--muted);line-height:1.6;margin:8px 0 0}
.card.highlight strong{color:var(--blue)}
.tabs{
  display:flex;
  gap:8px;
  overflow:auto;
  margin:18px 0;
  padding-bottom:5px;
}
.tabs button{
  white-space:nowrap;
  background:#fff;
  border:1px solid var(--border);
  color:var(--deep);
}
.tabs button.active{
  background:linear-gradient(135deg,var(--blue),var(--deep));
  color:#fff;
}
.tab{display:none}
.tab.active{display:block}
.panel{margin-bottom:16px}
.panel h3{margin:0 0 16px;color:var(--deep)}
.info-list,.reports,.alerts{display:grid;gap:10px}
.info-item,.report-item,.alert-item{
  background:#f8fbfd;
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
}
.info-item span,.report-item span{display:block;color:var(--muted);font-size:13px;margin-bottom:6px}
.pool-profile{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.pool-image{
  min-height:240px;
  background:#e9f5fb;
  border-radius:24px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
}
.pool-image img{width:100%;height:100%;object-fit:cover}
.pool-data{display:grid;gap:10px}
.photos{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
.photo{
  background:#e9f5fb;
  border-radius:20px;
  overflow:hidden;
  min-height:170px;
}
.photo img{width:100%;height:190px;object-fit:cover}
.contact-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}
.contact-grid a{
  text-decoration:none;
  background:#f0f9ff;
  border:1px solid var(--border);
  color:var(--deep);
  border-radius:18px;
  padding:16px;
  font-weight:900;
}
footer{
  text-align:center;
  color:var(--muted);
  padding:26px 0 10px;
  display:grid;
  gap:5px;
}
footer img{width:80px;margin:auto}
footer strong{color:var(--deep)}
footer a{color:var(--blue);text-decoration:none}
@media(max-width:800px){
  .app{padding:12px}
  .cards{grid-template-columns:1fr 1fr}
  .pool-profile{grid-template-columns:1fr}
  .photos{grid-template-columns:1fr 1fr}
  .welcome-hero{align-items:flex-start;flex-direction:column}
  .welcome-hero h2{font-size:25px}
  .big-health{width:100%}
}
@media(max-width:520px){
  .cards,.contact-grid{grid-template-columns:1fr}
  .photos{grid-template-columns:1fr}
  .hero-copy h1{font-size:25px}
}


/* Customer Portal v1.1.0 stability update */
.version-badge{
  display:block;
  text-align:center;
  margin-top:8px;
  color:#64748b;
  font-size:12px;
}
.update-notice{
  position:fixed;
  top:12px;
  left:50%;
  transform:translateX(-50%);
  z-index:9999;
  background:#0f172a;
  color:#fff;
  border-radius:999px;
  padding:10px 14px;
  display:flex;
  gap:10px;
  align-items:center;
  box-shadow:0 12px 35px rgba(15,23,42,.25);
  font-weight:800;
}
.update-notice button{
  background:#fff;
  color:#06466f;
  padding:7px 12px;
  border-radius:999px;
}


/* Customer Portal v1.2 report details */
.modal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  z-index:9998;
  padding:18px;
  overflow:auto;
}
.modal.active{display:flex;align-items:flex-start;justify-content:center}
.modal-card{
  width:min(900px,100%);
  background:#fff;
  border-radius:28px;
  padding:18px;
  box-shadow:0 25px 80px rgba(0,0,0,.25);
}
.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  border-bottom:1px solid var(--border);
  padding-bottom:12px;
  margin-bottom:14px;
}
.modal-head h3{margin:0;color:var(--deep)}
.modal-head button{
  width:42px;
  height:42px;
  border-radius:50%;
  padding:0;
  background:#eef7fb;
  color:var(--deep);
  font-size:22px;
}
.report-hero{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin-bottom:14px;
}
.report-hero div,.measure-item{
  background:#f8fbfd;
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
}
.report-hero span,.measure-item span{
  display:block;
  color:var(--muted);
  font-size:13px;
  margin-bottom:6px;
}
.report-hero strong,.measure-item strong{color:var(--deep)}
.report-section{
  border:1px solid var(--border);
  border-radius:20px;
  padding:15px;
  margin-bottom:12px;
  background:#fff;
}
.report-section h4{margin:0 0 10px;color:var(--deep)}
.report-section p{line-height:1.8;color:#334155}
.measure-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}
.report-media{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}
.media-thumb,.photo{
  position:relative;
  display:block;
  text-decoration:none;
  color:inherit;
}
.media-thumb img,.photo img{
  width:100%;
  height:170px;
  object-fit:cover;
  border-radius:16px;
  border:1px solid var(--border);
}
.media-thumb span,.photo span{
  display:block;
  margin-top:6px;
  color:var(--deep);
  font-weight:800;
  font-size:13px;
}
.signature-view{
  max-width:300px;
  max-height:120px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:8px;
  background:#fff;
}
.report-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.report-actions a,.report-actions button,.report-click button{
  text-decoration:none;
  background:linear-gradient(135deg,var(--blue),var(--deep));
  color:#fff;
  border-radius:14px;
  padding:12px 16px;
  font-weight:900;
  border:0;
}
.report-click{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
@media(max-width:700px){
  .report-hero,.measure-grid,.report-media{grid-template-columns:1fr}
  .report-click{align-items:flex-start;flex-direction:column}
  .report-click button{width:100%}
}


/* Customer Portal v1.3 requests + ratings */
.service-actions{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
.service-actions button:nth-child(2){
  background:linear-gradient(135deg,#dc2626,#991b1b);
}
.service-actions button:nth-child(3){
  background:linear-gradient(135deg,#0f766e,#064e3b);
}
.requests-list{display:grid;gap:10px}
.request-item{
  background:#f8fbfd;
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.request-item span{display:block;color:var(--muted);font-size:13px;margin-bottom:6px}
.request-item strong{color:var(--deep)}
.request-item p{margin:7px 0 0;color:#334155;line-height:1.7}
.request-item b{
  background:#eef7fb;
  color:var(--deep);
  padding:7px 10px;
  border-radius:999px;
  white-space:nowrap;
}
.request-item.emergency{border-color:#fecaca;background:#fff7f7}
.request-form textarea,.rating-form textarea{
  width:100%;
  min-height:120px;
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
  font-family:inherit;
  resize:vertical;
}
.request-form small,.rating-form small{
  display:block;
  color:var(--red);
  font-weight:700;
  margin-top:8px;
}
.small-modal{width:min(560px,100%)}
.stars{
  display:flex;
  justify-content:center;
  gap:8px;
  direction:ltr;
  margin:14px 0;
}
.stars button{
  background:#eef2f7;
  color:#94a3b8;
  width:48px;
  height:48px;
  border-radius:50%;
  padding:0;
  font-size:25px;
}
.stars button.active{
  background:#facc15;
  color:#78350f;
}
@media(max-width:700px){
  .service-actions{grid-template-columns:1fr}
  .request-item{flex-direction:column}
}


/* Blue Pool Customer Platform V2.0 */
.v2-panel{
  background:linear-gradient(180deg,#fff,#f8fcff);
}
.section-sub{
  color:var(--muted);
  margin-top:-8px;
  line-height:1.7;
}
.health-center-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}
.health-part{
  border:1px solid var(--border);
  background:#fff;
  border-radius:22px;
  padding:16px;
}
.health-part.good{border-top:5px solid #16a34a}
.health-part.warn{border-top:5px solid #d97706}
.health-part.bad{border-top:5px solid #dc2626}
.health-part-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}
.health-part-top span{font-weight:900;color:var(--deep)}
.health-part-top strong{font-size:24px}
.health-mini-bar{
  height:10px;
  background:#e5edf3;
  border-radius:999px;
  overflow:hidden;
  margin:12px 0;
}
.health-mini-bar i{
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--blue),var(--aqua));
  border-radius:999px;
}
.health-part p{margin:0;color:var(--muted)}
.equipment-center{
  display:grid;
  gap:12px;
}
.equipment-card{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:14px;
  border:1px solid var(--border);
  border-radius:24px;
  padding:14px;
  background:#fff;
}
.equipment-card img,.eq-placeholder{
  width:100%;
  height:170px;
  object-fit:cover;
  border-radius:18px;
  background:#e9f5fb;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-weight:900;
}
.equipment-card h4{margin:0 0 10px;color:var(--deep)}
.equipment-card p{margin:6px 0;color:#334155}
.timeline-list{
  position:relative;
  display:grid;
  gap:14px;
}
.timeline-item{
  position:relative;
  display:grid;
  grid-template-columns:22px 1fr;
  gap:10px;
  align-items:flex-start;
}
.timeline-dot{
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--blue);
  margin-top:6px;
  box-shadow:0 0 0 5px #e9f5fb;
}
.timeline-item div:last-child{
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
}
.timeline-item span{display:block;color:var(--muted);font-size:13px;margin-bottom:6px}
.timeline-item strong{color:var(--deep)}
.timeline-item p{margin:7px 0 0;color:#334155;line-height:1.7}
@media(max-width:700px){
  .health-center-grid{grid-template-columns:1fr}
  .equipment-card{grid-template-columns:1fr}
}


/* Blue Pool Customer Platform V2.1 + V2.2 */
.notifications-list{
  display:grid;
  gap:12px;
}
.notification-item{
  border:1px solid var(--border);
  border-radius:20px;
  padding:15px;
  background:#fff;
}
.notification-item b{color:var(--deep)}
.notification-item p{margin:8px 0 0;color:#334155;line-height:1.7}
.notification-item.good{border-right:5px solid #16a34a}
.notification-item.info{border-right:5px solid #0877bd}
.notification-item.warn{border-right:5px solid #d97706;background:#fffaf2}
.notification-item.bad{border-right:5px solid #dc2626;background:#fff7f7}
.pro-equipment{
  grid-template-columns:220px 1fr;
}
.equipment-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}
.eq-score{
  padding:8px 12px;
  border-radius:999px;
  color:#fff;
  font-weight:900;
}
.eq-score.good{background:#16a34a}
.eq-score.warn{background:#d97706}
.eq-score.bad{background:#dc2626}
.equipment-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:4px 14px;
}
.status-tag{
  padding:5px 9px;
  border-radius:999px;
  font-weight:800;
}
.status-tag.good{background:#dcfce7;color:#166534}
.status-tag.warn{background:#fef3c7;color:#92400e}
.status-tag.bad{background:#fee2e2;color:#991b1b}
.status-tag.neutral{background:#eef2f7;color:#334155}
.equipment-notes{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:10px;
}
.equipment-notes span{
  background:#f8fbfd;
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  color:#334155;
}
.pro-timeline .timeline-dot{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
  background:#fff;
  border:1px solid var(--border);
  box-shadow:0 0 0 5px #e9f5fb;
}
@media(max-width:700px){
  .pro-equipment{grid-template-columns:1fr}
  .equipment-grid{grid-template-columns:1fr}
}

/* Customer Platform V2.3 finance + offers */
.finance-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:14px}
.finance-card{background:#fff;border:1px solid var(--border);border-radius:22px;padding:16px}
.finance-card span{display:block;color:var(--muted);margin-bottom:8px}
.finance-card strong{font-size:25px;color:var(--deep)}
.finance-card.paid{border-top:5px solid #16a34a}.finance-card.due{border-top:5px solid #d97706}
.invoices-list,.offers-list{display:grid;gap:12px}
.invoice-item,.offer-card,.renew-card{display:flex;justify-content:space-between;gap:14px;align-items:center;background:#fff;border:1px solid var(--border);border-radius:22px;padding:16px}
.invoice-item span,.offer-card span{display:block;color:var(--muted);font-size:13px;margin-bottom:6px}
.invoice-item strong,.offer-card strong,.renew-card strong{display:block;color:var(--deep);font-size:18px}
.invoice-item p,.offer-card p,.renew-card p{color:#334155;line-height:1.7;margin:7px 0 0}
.invoice-actions a,.invoice-actions button,.offer-card button,.renew-card button{text-decoration:none;background:linear-gradient(135deg,var(--blue),var(--deep));color:#fff;border-radius:14px;padding:12px 14px;font-weight:900;border:0;white-space:nowrap}
.offer-card{border-top:5px solid #13b8c6}
.offer-card b{display:inline-block;margin-top:8px;background:#eef7fb;color:var(--deep);padding:6px 10px;border-radius:999px}
@media(max-width:700px){.finance-summary{grid-template-columns:1fr}.invoice-item,.offer-card,.renew-card{flex-direction:column;align-items:flex-start}.invoice-actions,.invoice-actions a,.invoice-actions button,.offer-card button,.renew-card button{width:100%;text-align:center}}
