
/* Portal styles (v1.0) — layered on top of /assets/styles.css */

/* Layout wrapper */
.ps-wrap{padding:22px 0 44px}
.ps-top{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.ps-top h2{margin:0;font-size:28px;letter-spacing:-.02em}
.ps-muted{color:var(--muted);line-height:1.6;font-weight:700}

/* Buttons */
.ps-btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:10px 14px;border-radius:999px;
  border:1px solid rgba(15,23,42,.12);
  background:#fff;color:#0b1220;
  font-weight:900;text-decoration:none;
  box-shadow:0 10px 28px rgba(15,23,42,.06);
}
.ps-btn:hover{background:rgba(241,245,249,.9)}
.ps-btn-primary{
  border-color:rgba(46,107,255,.22);
  background:linear-gradient(180deg,#2e6bff,#1d4ed8);
  color:#fff;
  box-shadow:0 12px 28px rgba(46,107,255,.22);
}
.ps-btn-primary:hover{filter:brightness(1.02)}

/* Grid/cards */
.ps-grid{display:grid;gap:14px;grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:980px){.ps-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.ps-grid{grid-template-columns:1fr}}
.ps-card{
  background:#fff;border:1px solid rgba(15,23,42,.10);
  border-radius:18px; padding:14px;
  box-shadow:0 10px 28px rgba(15,23,42,.06);
}

/* ===== Chat widget (Portal/Admin shared styles) ===== */
.cw{display:flex;flex-direction:column;height:70vh;max-height:720px;border:1px solid rgba(0,0,0,.08);border-radius:14px;overflow:hidden;background:#fff}
.cw-head{padding:12px 14px;border-bottom:1px solid rgba(0,0,0,.06);display:flex;justify-content:space-between;align-items:center}
.cw-title{font-weight:900}
.cw-sub{font-size:12px;opacity:.65}
.cw-body{flex:1;overflow:auto;padding:14px;background:linear-gradient(180deg, rgba(0,0,0,.02), transparent)}
.cw-row{display:flex;margin:8px 0}
.cw-row.mine{justify-content:flex-end}
.cw-bubble{max-width:78%;padding:10px 12px;border-radius:14px;position:relative;box-shadow:0 6px 18px rgba(0,0,0,.06)}
.cw-row.mine .cw-bubble{background:#e7f6ff;border-bottom-right-radius:6px}
.cw-row.theirs .cw-bubble{background:#f3f3f3;border-bottom-left-radius:6px}
.cw-text{white-space:pre-wrap;line-height:1.35}
.cw-time{margin-top:6px;font-size:11px;opacity:.55;text-align:right}
.cw-foot{display:flex;gap:10px;padding:10px;border-top:1px solid rgba(0,0,0,.06);align-items:flex-end}
.cw-foot textarea{flex:1;resize:none;border:1px solid rgba(0,0,0,.12);border-radius:12px;padding:10px;outline:none;min-height:42px}
.cw-foot button{padding:10px 14px;border-radius:12px;border:none;font-weight:900;cursor:pointer}
.ps-card h3{margin:0 0 8px;font-size:16px}
.ps-card .kpi{font-size:26px;font-weight:1000;letter-spacing:-.02em}

/* Badges */
.ps-badge{
  display:inline-flex;align-items:center;justify-content:center;
  padding:6px 10px;border-radius:999px;
  background:rgba(46,107,255,.10);
  border:1px solid rgba(46,107,255,.18);
  color:#143a9c;font-weight:900;font-size:12px;
}

/* Tables */
.ps-table{width:100%;border-collapse:collapse}
.ps-table th,.ps-table td{padding:12px 10px;border-bottom:1px solid rgba(15,23,42,.10);vertical-align:top}
.ps-table th{color:var(--muted);font-weight:900;font-size:13px;text-align:left}
.ps-table td{font-weight:800}

/* Inputs */
.ps-input, .ps-wrap input[type="text"], .ps-wrap input[type="email"], .ps-wrap input[type="password"], .ps-wrap select, .ps-wrap textarea{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.14);
  background:#fff;
  font-weight:800;
}
.ps-wrap textarea{min-height:120px;resize:vertical}

/* Alerts */
.ps-success{padding:12px 14px;border-radius:14px;background:rgba(34,197,94,.10);border:1px solid rgba(34,197,94,.20);color:#14532d;font-weight:900}
.ps-error{padding:12px 14px;border-radius:14px;background:rgba(239,68,68,.10);border:1px solid rgba(239,68,68,.20);color:#7f1d1d;font-weight:900}

/* Login page helpers */
.portal-login-wrap{padding:46px 0}
.portal-login-card{max-width:560px;margin:0 auto;padding:22px}
.portal-login-card h2{margin:0 0 6px;font-size:20px}
.portal-login-card p{margin:0 0 14px;color:var(--muted)}
.portal-login-card .field{margin-top:12px}
.portal-login-card label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px;font-weight:800}
.portal-login-card input[type="email"],
.portal-login-card input[type="password"]{
  width:100%;
  padding:14px 16px;
  border:1px solid rgba(15,23,42,.14);
  border-radius:999px;
  background:#fff;
  font-weight:800;
}
.portal-login-card .remember{display:flex;gap:10px;align-items:center;margin-top:12px;font-size:13px;color:var(--muted);font-weight:700}
.portal-login-card .btn.primary{width:100%}


/* =========================
   MODAL LEAD — Saude (pretty)
   Scope: #modal-lead only
   ========================= */
#modal-lead{
  --bg:#ffffff;
  --ink:#0f172a;
  --mut:rgba(15,23,42,.65);
  --line:rgba(15,23,42,.10);
  --p1:#0ea5e9;
  --p2:#22c55e;
}

#modal-lead .modal__card{
  background:var(--bg);
  border-radius:16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  border:1px solid rgba(15,23,42,.10);
}

#modal-lead .modal__head{
  position:sticky; top:0; z-index:10;
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.92));
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  padding-bottom:10px;
  margin-bottom:6px;
}

#modal-lead .lh-section{
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,1));
}

#modal-lead .lh-sec-title{
  display:flex; align-items:center; gap:10px;
  font-weight:900; margin-bottom:10px;
}
#modal-lead .lh-sec-title i{ color:var(--p1); }
#modal-lead .lh-sec-sub{
  color:var(--mut);
  line-height:1.6;
  margin:-6px 0 10px;
  font-size:13px;
}

/* fields */
#modal-lead .field label{
  display:block;
  font-weight:800;
  font-size:13px;
  margin:0 0 6px;
  color:rgba(15,23,42,.85);
}

#modal-lead input[type="text"],
#modal-lead input[type="email"],
#modal-lead input[type="tel"],
#modal-lead input[type="number"],
#modal-lead input[type="date"],
#modal-lead select,
#modal-lead textarea{
  width:100%;
  border:1px solid rgba(15,23,42,.14);
  background:#fff;
  color:var(--ink);
  border-radius:12px;
  padding:11px 12px;
  outline:none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

#modal-lead textarea{ resize:vertical; min-height:92px; }

#modal-lead input:focus,
#modal-lead select:focus,
#modal-lead textarea:focus{
  border-color:rgba(14,165,233,.45);
  box-shadow: 0 0 0 4px rgba(14,165,233,.12);
}

#modal-lead input[type="file"]{
  width:100%;
  border:1px dashed rgba(15,23,42,.20);
  border-radius:14px;
  padding:12px;
  background:rgba(15,23,42,.02);
}

/* grids */
#modal-lead .lh-grid{ display:grid; gap:10px; }
#modal-lead .lh-grid.cols-2{ grid-template-columns:repeat(2,1fr); }
#modal-lead .lh-grid.cols-3{ grid-template-columns:repeat(3,1fr); }
#modal-lead .lh-grid.cols-4{ grid-template-columns:repeat(4,1fr); }

@media (max-width: 860px){
  #modal-lead .lh-grid.cols-2,
  #modal-lead .lh-grid.cols-3,
  #modal-lead .lh-grid.cols-4{ grid-template-columns:1fr; }
}

/* radio cards */
#modal-lead .lh-radio-card{
  position:relative;
  border:1px solid rgba(15,23,42,.12);
  border-radius:14px;
  padding:12px;
  background:#fff;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
#modal-lead .lh-radio-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
  border-color:rgba(14,165,233,.25);
}
#modal-lead .lh-radio-card input{
  position:absolute;
  right:12px; top:12px;
  width:16px;height:16px;
}
#modal-lead .lh-radio-title{ font-weight:900; margin-top:2px; }
#modal-lead .lh-radio-desc{
  color:var(--mut);
  font-size:13px;
  line-height:1.45;
  margin-top:4px;
}
#modal-lead .lh-radio-card:has(input:checked){
  border-color: rgba(34,197,94,.45);
  box-shadow: 0 0 0 4px rgba(34,197,94,.12);
  background: linear-gradient(135deg, rgba(14,165,233,.04), rgba(34,197,94,.04));
}

/* checkbox rows */
#modal-lead .lh-check{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:8px 10px;
  border:1px solid rgba(15,23,42,.10);
  border-radius:12px;
  background:#fff;
}
#modal-lead .lh-check:hover{ border-color:rgba(14,165,233,.20); }
#modal-lead .lh-check input{ margin-top:3px; }
#modal-lead .lh-check span{ color:var(--mut); line-height:1.45; }

#modal-lead #lh_submitBtn{
  border-radius:14px;
  padding:12px 14px;
  font-weight:900;
  box-shadow: 0 14px 34px rgba(14,165,233,.15);
}

/* === VIEWPORT HARDENING v1.0.2 === */
/* Goal: no horizontal scroll; keep layouts readable across admin/site/portal */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }

/* Prevent long strings/URLs from breaking layouts */
.break-anywhere { overflow-wrap: anywhere; word-break: break-word; }
.nowrap { white-space: nowrap; }

/* Tables: prefer wrapping over horizontal scrolling */
table { width: 100%; max-width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }

/* Code blocks can explode width */
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 760px){
  th, td { padding: 10px 10px !important; font-size: 13px; }
}


/* lead meta list */
.meta-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.meta-list li{padding:10px 12px;border:1px solid var(--border,#e6e6e6);border-radius:12px;background:var(--card,#fff)}
.meta-list strong{display:inline-block;margin-right:6px}
