/* WhatsApp Business Hub (Phase 40). Uses the tokens of app.css. */
:root { --wa: #128C4B; --wa-soft: #DDF5E6; --bubble-in: var(--surface); --bubble-out: #DCF8C6; }
@media (prefers-color-scheme: dark) { :root { --wa: #3DCB7C; --wa-soft: #173A27; --bubble-out: #1E4630; } }

.hub-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 18px; padding-bottom: 2px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.hub-tabs a { white-space: nowrap; padding: 9px 14px; border-radius: 10px 10px 0 0; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; }
.hub-tabs a:hover { color: var(--ink); background: var(--sunk); }
.hub-tabs a[aria-current="page"] { color: var(--wa); border-bottom-color: var(--wa); }

.hub-hero { background: linear-gradient(135deg, #0B6B57, #128C4B); color: #fff; border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.hub-hero a:not(.btn) { color: #fff; }
.hub-hero .muted, .hub-hero .note { color: rgba(255,255,255,.82); }
.hub-balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.hub-balance { background: rgba(255,255,255,.12); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.hub-balance b { font-size: 28px; line-height: 1.1; }

.hub-stat { display: grid; gap: 2px; }
.hub-progress { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.hub-progress > span { display: block; height: 100%; background: var(--wa); border-radius: 99px; }

/* pricing cards */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.price-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.price-card.is-popular { border: 2px solid var(--wa); box-shadow: 0 8px 24px rgba(18,140,75,.15); }
.price-card .price-badge { position: absolute; top: -11px; left: 18px; background: var(--wa); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.price-card h3 { margin: 0; font-size: 18px; }
.price-amount { font-size: 28px; font-weight: 800; line-height: 1.1; }
.price-units { color: var(--wa); font-weight: 700; }
.price-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; flex: 1; }
.price-card li::before { content: "✓"; color: var(--wa); font-weight: 800; margin-right: 8px; }

/* chats */
.chat-layout { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .chat-layout { grid-template-columns: 1fr; } .chat-layout.has-open .chat-list { display: none; } }
.chat-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-list li + li { border-top: 1px solid var(--line); }
.chat-list a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 12px; color: inherit; text-decoration: none; align-items: center; }
.chat-list a:hover, .chat-list a[aria-current="page"] { background: var(--sunk); }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--wa-soft); color: var(--wa); display: grid; place-items: center; font-weight: 800; }
.chat-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-unread { background: var(--wa); color: #fff; border-radius: 99px; font-size: 12px; font-weight: 700; padding: 1px 7px; }
.chat-thread { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; }
.bubble { max-width: min(80%, 520px); padding: 8px 12px; border-radius: 12px; background: var(--bubble-in); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); border-color: transparent; }
.bubble.note { align-self: center; background: var(--gold-soft); border-style: dashed; font-size: 14px; }
.bubble-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }
.chat-compose { display: grid; gap: 8px; margin-top: 12px; }
.chat-compose textarea { min-height: 80px; width: 100%; }
.price-card .num { font-family: inherit; }
