/* ============ Dave on Duty — portal.css ============
   Shared styles for every customer-portal page (Overview, Build your bot,
   Bot settings, Inbox, Install, Plan & billing, Account settings). Each page
   is now its own URL — the avatar menu (top right) is the single nav hub. */
.portal{width:min(1080px,94%);margin:6.5rem auto 4rem}
.portal-head{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1.6rem}
.portal-head h1{font-size:1.5rem}
.portal-head .who{color:var(--muted);font-size:.88rem}
.portal-head .spacer{flex:1}
/* Avatar button + dropdown styles now live in style.css (shared with the
   marketing pages' session-aware nav) — single source of truth. */
.banner{border:1px solid rgba(129,140,248,.4);background:rgba(99,102,241,.1);border-radius:14px;padding:.9rem 1.2rem;font-size:.92rem;margin-bottom:1.4rem}
.banner.warn{border-color:rgba(245,158,11,.5);background:rgba(245,158,11,.08)}
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1rem;margin-bottom:1.6rem}
.tile{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:1.2rem}
.tile .n{font-family:var(--font-head);font-size:1.9rem;font-weight:800}
.tile .l{color:var(--muted);font-size:.83rem}
.tile .w{color:#6ee7b7;font-size:.78rem}
.card{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:1.5rem;margin-bottom:1.2rem}
.card h3{font-size:1.05rem;margin-bottom:.9rem;color:#8fd8ff}
.frow{display:grid;grid-template-columns:1fr 1fr;gap:.9rem}
.field{margin-bottom:.9rem}
.field label{display:block;font-size:.78rem;color:var(--muted);margin-bottom:.3rem;font-weight:600}
.field input,.field select,.field textarea{width:100%;background:rgba(255,255,255,.05);border:1px solid var(--line);border-radius:10px;padding:.65rem .85rem;color:var(--text);font:inherit;font-size:.9rem;outline:none}
/* selects get a SOLID dark background: some browsers paint the native popup
   list using the select's own background, and a translucent white computes
   to white there — light text on white, unreadable */
.field select{background:#141c38}
.field textarea{min-height:70px;resize:vertical}
.field input:focus,.field textarea:focus{border-color:rgba(129,140,248,.6)}
.colorrow{display:flex;gap:.6rem;align-items:center}
.colorrow input[type=color]{width:44px;height:36px;padding:2px;cursor:pointer}
.savebar{display:flex;gap:.8rem;align-items:center}
.saved{color:#6ee7b7;font-size:.88rem}
table{width:100%;border-collapse:collapse;font-size:.85rem}
th,td{text-align:left;padding:.5rem .6rem;border-bottom:1px solid var(--line);vertical-align:top;max-width:320px;overflow-wrap:break-word}
th{color:#8fd8ff;font-weight:600;text-transform:uppercase;font-size:.7rem;letter-spacing:.08em}
.empty{color:var(--muted);padding:1.6rem;text-align:center;border:1px dashed var(--line);border-radius:12px}
.snippet{background:#04101f;border:1px solid var(--line);border-radius:12px;padding:1rem;font-family:monospace;font-size:.82rem;line-height:1.55;white-space:pre;overflow-x:auto;color:#8fd8ff;tab-size:2}
.snippet .add{background:rgba(52,211,153,.16);box-shadow:-4px 0 0 rgba(52,211,153,.16),-6px 0 0 #34d399;border-radius:2px;color:#d6ffe9}
.plans{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}
.plancard{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:1.4rem;text-align:center;display:flex;flex-direction:column}
/* Push the "what we'd need" + button footer to the bottom so every card's
   button lines up on the same baseline regardless of feature-list length. */
.plancard details.needs{margin-top:auto}
.plancard.current{border-color:rgba(34,211,238,.6);box-shadow:0 0 0 1px rgba(34,211,238,.35)}
.plancard h4{font-size:1.05rem}
.plancard .pp{font-family:var(--font-head);font-size:1.7rem;font-weight:800;margin:.4rem 0}
.plancard ul{list-style:none;text-align:left;margin:.8rem 0;color:var(--muted);font-size:.83rem;display:flex;flex-direction:column;gap:.35rem}
.subtabs{display:flex;gap:.4rem;margin-bottom:1rem;flex-wrap:wrap}
.subtab{padding:.4rem .9rem;border-radius:999px;border:1px solid var(--line);cursor:pointer;font-size:.82rem;font-weight:600;color:var(--muted);background:none}
.subtab.active{background:rgba(129,140,248,.2);color:var(--text);border-color:rgba(129,140,248,.5)}
.spin{display:inline-block;width:12px;height:12px;border:2px solid var(--line);border-top-color:#8fd8ff;border-radius:50%;animation:spin 1s linear infinite;vertical-align:-2px;margin-right:.35rem}
@keyframes spin{to{transform:rotate(360deg)}}
details.needs{margin:.7rem 0 0;text-align:left;font-size:.82rem;color:var(--muted)}
details.needs summary{cursor:pointer;color:#8fd8ff;font-weight:600;font-size:.84rem;list-style:none}
details.needs summary::-webkit-details-marker{display:none}
details.needs p{margin-top:.45rem;line-height:1.55}
.cmp-wrap{overflow-x:auto}
.ntog{display:flex;align-items:flex-start;gap:.6rem;font-size:.9rem;color:var(--text);cursor:pointer;line-height:1.4}
.ntog input{margin-top:.15rem;width:16px;height:16px;flex:none;cursor:pointer}
.ntog span strong{font-weight:600}
/* Billing & payments panel */
.bill-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap}
.bill-plan{font-family:var(--font-head);font-size:1.5rem;font-weight:800;line-height:1.1}
.bill-price{color:var(--muted);font-size:.9rem;margin-top:.15rem}
.bill-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.9rem;margin-top:1.1rem}
.bill-cell{background:rgba(255,255,255,.03);border:1px solid var(--line);border-radius:12px;padding:.8rem .9rem}
.bill-cell .k{font-size:.68rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:700}
.bill-cell .v{font-size:.98rem;margin-top:.3rem;font-weight:600}
.badge{display:inline-block;padding:.22rem .6rem;border-radius:999px;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;border:1px solid transparent}
.badge.ok{background:rgba(52,211,153,.12);color:#6ee7b7;border-color:rgba(52,211,153,.4)}
.badge.warn{background:rgba(251,191,36,.12);color:#fcd34d;border-color:rgba(251,191,36,.4)}
.badge.bad{background:rgba(244,63,94,.12);color:#fda4af;border-color:rgba(244,63,94,.4)}
.badge.info{background:rgba(129,140,248,.15);color:#c7d2fe;border-color:rgba(129,140,248,.4)}
.pay-status{font-weight:700;font-size:.75rem;text-transform:capitalize}
.pay-status.paid{color:#6ee7b7}
.pay-status.open{color:#fcd34d}
.pay-status.void,.pay-status.uncollectible{color:#fda4af}
.ready-row{display:flex;gap:.6rem;flex-wrap:wrap;margin-bottom:1.2rem}
.ready{padding:.45rem .9rem;border-radius:999px;border:1px solid var(--line);font-size:.83rem;font-weight:600;color:var(--muted)}
.ready.ok{border-color:rgba(52,211,153,.5);color:#6ee7b7;background:rgba(52,211,153,.08)}
/* Build-your-bot: one tab per plan, only that plan's settings inside */
.plan-tabs{display:flex;gap:.6rem;margin-bottom:1rem;flex-wrap:wrap}
.plan-tab{display:inline-flex;align-items:center;gap:.5rem;padding:.62rem 1.25rem;border-radius:12px;border:1px solid var(--line);cursor:pointer;font-size:.95rem;font-weight:700;color:var(--muted);background:var(--panel);transition:border-color .15s,color .15s,transform .12s}
.plan-tab:hover{color:var(--text);border-color:rgba(129,140,248,.45)}
.plan-tab.active{background:var(--grad);color:#04101f;border-color:transparent}
.plan-tab .rd{font-size:.85rem;line-height:1;color:var(--muted)}
.plan-tab .rd.ok{color:#34d399}
.plan-tab.active .rd,.plan-tab.active .rd.ok{color:#04412c}
/* A plan above the account's own is a PREVIEW, never something they own. It
   carries a padlock instead of the green readiness tick, and opening it gives
   a muted selected-state — the bright gradient stays reserved for a plan the
   customer is actually paying for. */
.plan-tab.locked{color:var(--muted);border-style:dashed}
.plan-tab.locked.active{background:rgba(129,140,248,.14);color:var(--text);border-color:rgba(129,140,248,.55);border-style:solid}
.plan-tab.locked.active .rd{color:var(--muted)}
.tab-status{margin-bottom:1.2rem}
.tab-status .badge{letter-spacing:.02em}
.src{display:flex;align-items:center;gap:.6rem;padding:.5rem .7rem;border:1px solid var(--line);border-radius:10px;margin-top:.5rem;font-size:.86rem}
.src .t{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.src .k{color:var(--muted);font-size:.74rem}
.src button{background:none;border:none;color:#fca5a5;cursor:pointer;font-size:.95rem}
.svc-row{display:flex;gap:.5rem;margin-bottom:.5rem;align-items:center}
.svc-row input[type=text]{flex:1}
.svc-row input[type=number]{width:90px}
.hours-row{display:grid;grid-template-columns:52px 70px 1fr 1fr;gap:.5rem;align-items:center;margin-bottom:.4rem;font-size:.85rem}
.lvl-tag{font-size:.68rem;font-weight:700;letter-spacing:.08em;color:#8fd8ff;background:rgba(34,211,238,.08);border:1px solid rgba(34,211,238,.25);padding:.18rem .55rem;border-radius:999px;vertical-align:2px;margin-left:.5rem}
.steps-list{padding-left:1.3rem;display:flex;flex-direction:column;gap:.55rem;font-size:.9rem;line-height:1.6}
.steps-list code, .plat code{background:rgba(255,255,255,.07);padding:.08rem .35rem;border-radius:6px;font-size:.84em}
.plat .muted, .muted{color:var(--muted);font-size:.82rem}
.plat{margin-top:.4rem}
@media (max-width:560px){ .frow{grid-template-columns:1fr} .portal-head .spacer{display:none} }

/* messaging-channel connection status (WhatsApp / Messenger) */
.chan-status{
  border-radius:10px;padding:.6rem .8rem;margin:.2rem 0 .8rem;
  font-size:.84rem;line-height:1.5;border:1px solid var(--line);
  background:rgba(255,255,255,.03);
}
.chan-status.ok{border-color:rgba(52,211,153,.4);background:rgba(52,211,153,.08);color:#bff3dc}
.chan-status.warn{border-color:rgba(251,191,36,.4);background:rgba(251,191,36,.07);color:#fde2a7}
.chan-status.bad{border-color:rgba(244,63,94,.4);background:rgba(244,63,94,.07);color:#fecdd3}
.chan-status .chan-when{display:block;opacity:.65;font-size:.74rem;margin-top:.2rem}
