/* WhatsApp screen in the staff admin: phone link, inbox, broadcasts. Colours come from app.css. */
.wa-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.wa-head h1 { margin: 0; }
.wa-head .seg a { display: inline-block; background: #fff; padding: 9px 16px; font-size: 14.5px; color: var(--ink); text-decoration: none; border-right: 1px solid var(--border); }
.wa-head .seg a:last-child { border-right: 0; }
.wa-head .seg a.on { background: var(--gold); font-weight: 700; }
.wa-head .seg .n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--good); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; font-weight: 700; }
.wa-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.wa-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.wa-dot.good { background: var(--good); } .wa-dot.warn { background: var(--warn); } .wa-dot.bad { background: var(--bad); }

/* phone link */
.wa-link { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.wa-qr { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.wa-qr svg { width: 100%; max-width: 276px; height: auto; display: block; margin: 0 auto; }
.wa-qr .wait { padding: 60px 10px; color: var(--ink-muted); }
.wa-steps { margin: 8px 0 0; padding-left: 20px; } .wa-steps li { margin-bottom: 6px; }

/* inbox */
.wa-inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; height: calc(100vh - 190px); min-height: 460px; }
.wa-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.wa-list .tools { padding: 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.wa-list .tools input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.wa-list .newchat { display: flex; gap: 6px; } .wa-list .newchat input { flex: 1; }
.wa-chats { overflow-y: auto; flex: 1; }
.wa-chat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.wa-chat:hover { background: var(--gold-soft); }
.wa-chat.on { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.wa-chat .who { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat .t { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
.wa-chat .last { font-size: 13px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat.unread .who, .wa-chat.unread .last { color: var(--ink); font-weight: 700; }
.wa-chat .n { background: var(--good); color: #fff; border-radius: 10px; font-size: 11.5px; font-weight: 700; min-width: 20px; padding: 0 6px; line-height: 20px; text-align: center; justify-self: end; }
.wa-chat .sub { font-size: 12px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 1 / -1; }
.wa-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.wa-pane .ph { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.wa-pane .ph b { font-size: 15.5px; }
.wa-pane .ph .mut { font-size: 12.5px; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 14px; background: var(--surface-sunken); display: flex; flex-direction: column; gap: 6px; }
.wa-day { align-self: center; font-size: 11.5px; color: var(--ink-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 2px 10px; margin: 6px 0; }
.wa-b { max-width: 72%; padding: 7px 10px 5px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-size: 14px; align-self: flex-start; }
.wa-b.out { align-self: flex-end; background: #E7F4DF; border-color: #CDE6BE; }
.wa-b.failed { background: #FCEBEA; border-color: #F2C4C0; }
.wa-b .meta { display: block; text-align: right; font-size: 11px; color: var(--ink-faint); margin-top: 3px; white-space: normal; }
.wa-b .err { display: block; color: var(--bad); font-size: 12px; margin-top: 3px; white-space: normal; }
.wa-b img { display: block; max-width: 260px; max-height: 260px; border-radius: 6px; margin-bottom: 4px; cursor: zoom-in; }
.wa-b a.file { display: inline-block; margin-bottom: 4px; font-weight: 600; }
.wa-compose { border-top: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.wa-compose textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; resize: vertical; min-height: 44px; }
.wa-compose .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.wa-compose input[type=file] { font-size: 12.5px; max-width: 100%; }
.wa-empty { margin: auto; color: var(--ink-faint); text-align: center; padding: 30px; }
.wa-back { display: none; }

/* broadcasts */
.wa-warn { border-left: 4px solid var(--warn); }
.wa-warn ul { margin: 6px 0 0; padding-left: 20px; } .wa-warn li { margin-bottom: 3px; }
.wa-compose-b { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.wa-compose-b textarea { min-height: 150px; }
.wa-aud label.opt { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--ink); }
.wa-aud .prow { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); margin: 0; }
.wa-pick { border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; }
.wa-pick .ptools { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--border); align-items: center; flex-wrap: wrap; }
.wa-pick .ptools input[type=search] { flex: 1; min-width: 150px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.wa-pick .plist { max-height: 260px; overflow-y: auto; }
.wa-pick .prow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; cursor: pointer; }
.wa-pick .prow:last-child { border-bottom: 0; }
.wa-pick .prow.nomob { color: var(--ink-faint); }
.wa-count { font-size: 15px; margin: 10px 0 4px; } .wa-count b { font-size: 22px; }
.wa-left { font-size: 13px; color: var(--ink-muted); margin: 0; padding-left: 18px; }
.wa-preview { background: var(--surface-sunken); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; }
.wa-preview .wa-b { max-width: 100%; align-self: flex-end; }
.wa-qstate { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.wa-qstate .capset { display: flex; gap: 6px; align-items: center; } .wa-qstate .capset input { width: 80px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; }
.wa-bar { height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; display: flex; min-width: 120px; margin-top: 4px; }
.wa-bar span { display: block; height: 100%; } .wa-bar .s { background: var(--good); } .wa-bar .f { background: var(--bad); } .wa-bar .k { background: var(--ink-faint); }
.wa-snip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
    .wa-link, .wa-compose-b { grid-template-columns: 1fr; }
    .wa-inbox { grid-template-columns: 1fr; height: auto; min-height: 0; }
    .wa-inbox .wa-list { border-right: 0; max-height: 70vh; }
    .wa-inbox.open .wa-list { display: none; }
    .wa-inbox:not(.open) .wa-pane { display: none; }
    .wa-inbox .wa-msgs { min-height: 50vh; max-height: 60vh; }
    .wa-back { display: inline-block; }
    .wa-b { max-width: 88%; }
    .wa-snip { max-width: 180px; }
}
