/* WPSender Pro panel — no framework, design tokens + a handful of components */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --text: #17202c;
  --muted: #637083;
  --brand: #12a150;
  --brand-600: #0e8a44;
  --brand-50: #e8f7ee;
  --blue: #2563eb;  --blue-50: #e8effd;
  --amber: #b45309; --amber-50: #fdf3e2;
  --red: #dc2626;   --red-50: #fdecec;
  --gray-50: #eef0f3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --sidebar: 248px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a; --surface: #161c24; --surface-2: #1d2530; --border: #2a3441;
    --text: #e6ebf1; --muted: #93a0b0; --brand: #22c06a; --brand-600: #1aa35a; --brand-50: #14301f;
    --blue: #6b9cff; --blue-50: #172540; --amber: #f0b45a; --amber-50: #33270f;
    --red: #f37676; --red-50: #3a1a1a; --gray-50: #222a35;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; }
.nav { padding: 6px 10px 20px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-50); color: var(--brand-600); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.main { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.content { padding: 28px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.menu-btn { display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; font-weight: 650; font-size: 12px; }
.plan-chip { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.banner { padding: 10px 28px; font-size: 13px; background: var(--amber-50); color: var(--amber); border-bottom: 1px solid var(--border); }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .topbar .plan-chip { display: none; }
}

/* Slim layout (auth) */
.slim { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.slim-card { width: 100%; max-width: 420px; }
.slim-card.wide { max-width: 640px; }
.slim .brand { justify-content: center; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 22px; color: var(--text); }

/* Cards & grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -.01em; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.right { margin-left: auto; }

/* Bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar span { width: 100%; max-width: 28px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.bars .bar small { font-size: 10px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--brand-50); color: var(--brand-600); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-gray { background: var(--gray-50); color: var(--muted); }

/* Forms */
label { display: block; font-weight: 550; margin-bottom: 6px; font-size: 13px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number],
input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
input[type=file] { font: inherit; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 450; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 550; cursor: pointer; background: var(--brand); color: #fff; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--brand-600); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: var(--red); filter: brightness(.92); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-600); font: inherit; cursor: pointer; }
.link-btn.danger { color: var(--red); }

/* Alerts */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 13.5px; border: 1px solid transparent; }
.alert-success { background: var(--brand-50); color: var(--brand-600); }
.alert-error { background: var(--red-50); color: var(--red); }
.alert-info { background: var(--blue-50); color: var(--blue); }
.alert-warn { background: var(--amber-50); color: var(--amber); }

/* Key/value + code */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
pre.code { background: #0f1720; color: #d7e0ea; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font: 12.5px/1.55 var(--mono); margin: 0; }
.secret { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 6px 6px 12px; }
.secret code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* QR pairing */
.qr-box { display: grid; place-items: center; min-height: 300px; background: var(--surface-2); border-radius: var(--radius); padding: 20px; text-align: center; }
.qr-box img { width: 280px; height: 280px; background: #fff; padding: 10px; border-radius: 10px; image-rendering: pixelated; }
.pair-code { font: 600 30px/1 var(--mono); letter-spacing: .18em; padding: 16px 22px; background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; }
.steps { margin: 0; padding-left: 18px; color: var(--muted); }
.steps li { margin-bottom: 6px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--brand-600); border-color: var(--brand); text-decoration: none; }

/* Pagination */
.pager { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 16px; border-top: 1px solid var(--border); }

/* Pricing */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.plan { position: relative; }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan .price { font-size: 28px; font-weight: 700; margin: 8px 0 2px; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 18px; }
.plan li { padding: 4px 0; color: var(--muted); }
.plan li strong { color: var(--text); }
.ribbon { position: absolute; top: 14px; right: 14px; font-size: 11px; background: var(--brand); color: #fff; padding: 2px 8px; border-radius: 99px; }

/* Chat (support) */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 75%; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); white-space: pre-wrap; word-break: break-word; }
.msg.mine { align-self: flex-end; background: var(--brand-50); }
.msg small { display: block; margin-top: 4px; font-size: 11px; }

.dropdown { position: relative; }
.toast-close { float: right; background: none; border: 0; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }

/* account */
input[type=date] { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.filters { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); align-items: end; }
.filters > div > label { margin-bottom: 4px; }
.kw-chip { display: inline-block; padding: 1px 8px; margin: 2px 0; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.cell-clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.cell-clip small { white-space: nowrap; }
.err-text { color: var(--red); font-size: 12px; word-break: break-word; }
tr.detail-row td { padding-top: 0; background: transparent; }
tr.detail-row summary { cursor: pointer; font-size: 12.5px; }
table tr:has(+ tr.detail-row) td { border-bottom: 0; }
.notif { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.notif:last-of-type { border-bottom: 0; }
.notif.unread { background: var(--blue-50); }
.notif h3 { display: flex; align-items: center; gap: 8px; }
.feature-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.feature-list span { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--gray-50); color: var(--muted); text-decoration: line-through; }
.feature-list span.on { background: var(--brand-50); color: var(--brand-600); text-decoration: none; }
.plan-buy { display: flex; flex-direction: column; }
.plan-buy .ribbon { max-width: 60%; text-align: center; }
.plan-buy h3 { padding-right: 90px; }
.instructions { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; }
.paytr-frame { overflow: hidden; }

/* messaging */
.msg-vars { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.msg-chip { font: 12px var(--mono); padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.msg-chip:hover { border-color: var(--brand); color: var(--brand-600); }
.msg-preview { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; max-height: 220px; overflow: auto; }
.msg-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; max-height: 260px; overflow-y: auto; padding: 2px; }
.msg-checks .check { margin: 0; }
.msg-bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.msg-bulkbar select { padding: 5px 10px; font-size: 13px; }
.msg-media { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; margin-bottom: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; word-break: break-all; }
.msg-media svg { vertical-align: -3px; }
.msg-group-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 420px; overflow-y: auto; }
.msg-group { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.msg-group:hover { background: var(--surface-2); }
.msg-group.active { border-color: var(--brand); background: var(--brand-50); }
.msg-inline-edit summary { cursor: pointer; font-size: 12px; margin-top: 2px; }
.msg-inline-edit[open] { margin-bottom: 4px; }

/* admin */
.admin-filter input[type=search] { flex: 1; min-width: 200px; max-width: 420px; }
.admin-link-card { color: inherit; display: block; transition: border-color .15s; }
.admin-link-card:hover { text-decoration: none; border-color: var(--brand); }
.admin-bars { gap: 3px; }
.admin-bars .bar small { font-size: 9px; white-space: nowrap; }
@media (max-width: 900px) { .admin-bars .bar small { display: none; } }
tr:has(+ .admin-subrow) td { border-bottom: 0; }
.admin-subrow td { padding-top: 0; font-size: 13px; }
.admin-pre { white-space: pre-wrap; word-break: break-word; }
.admin-clip { max-height: 4.6em; overflow: hidden; max-width: 520px; }
.admin-json { display: block; max-width: 420px; white-space: pre-wrap; word-break: break-all; font-size: 11.5px; color: var(--muted); }
.admin-chips { gap: 6px; }
.admin-chips code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }

/* device chats */
.chat-list { display: flex; flex-direction: column; }
.chat-item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); color: var(--text); align-items: flex-start; }
.chat-item:hover { background: var(--surface-2); text-decoration: none; }
.chat-item.unread strong { font-weight: 700; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; }
.chat-avatar.group { background: var(--blue-50); color: var(--blue); }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-top, .chat-bottom { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.chat-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-top small { white-space: nowrap; }
.chat-preview { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-unread { background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; flex: none; }
.chat-window { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 480px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px 20px; background: var(--bg); display: flex; flex-direction: column; }
.chat-body [data-chat-messages] { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: min(75%, 560px); align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px 12px 12px 4px; padding: 8px 12px; box-shadow: var(--shadow); }
.bubble.mine { align-self: flex-end; background: var(--brand-50); border-color: transparent; border-radius: 12px 12px 4px 12px; }
.bubble-sender { font-size: 12px; font-weight: 650; color: var(--blue); margin-bottom: 2px; }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.bubble-kind { color: var(--muted); font-size: 13px; }
.bubble-time { font-size: 11px; color: var(--muted); text-align: right; margin-top: 4px; }
.bubble-img { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; margin-bottom: 4px; }
.bubble video { max-width: 100%; max-height: 320px; border-radius: 8px; }
.bubble audio { max-width: 260px; }
.bubble-file { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; }
.chat-compose { border-top: 1px solid var(--border); padding: 12px 20px; background: var(--surface); }
.chat-compose textarea { min-height: 46px; }
@media (max-width: 700px) { .chat-window { height: calc(100vh - 200px); } .bubble { max-width: 88%; } }

/* sending */
.tick { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.tick-read { color: var(--blue); }

/* device tools */
.chat-avatar { position: relative; overflow: hidden; }
.chat-avatar .avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tools-name { flex-wrap: nowrap; gap: 10px; }
.tools-name .chat-avatar { width: 34px; height: 34px; font-size: 12px; }
.tools-name .chat-avatar svg { width: 16px; height: 16px; }
.tools-row { margin-bottom: 18px; }
.tools-add { padding: 10px 20px; border-bottom: 1px solid var(--border); }
.tools-add summary { cursor: pointer; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; }
.tools-add form { margin-top: 10px; }
a[aria-busy="true"] { pointer-events: none; opacity: .7; }

/* inbox (WhatsApp Web layout) */
.inbox { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; height: calc(100vh - 215px); min-height: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.inbox-list { display: flex; flex-direction: column; border-right: 1px solid var(--border); min-width: 0; min-height: 0; }
.inbox-search { padding: 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.inbox-search input { border-radius: 99px; background: var(--surface-2); }
.inbox-filters { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.inbox-filters button { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 3px 11px; font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.inbox-filters button.on { background: var(--brand-50); color: var(--brand-600); border-color: transparent; font-weight: 600; }
.inbox-items { flex: 1; overflow-y: auto; }
.inbox-items .chat-item { padding: 10px 14px; }
.inbox-items .chat-item.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand); }
.inbox-pane { min-width: 0; min-height: 0; display: flex; }
.pane-empty { margin: auto; text-align: center; max-width: 360px; padding: 30px; }
.pane-empty-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; margin: 0 auto 14px; }
.pane-empty-icon svg { width: 28px; height: 28px; }
.pane { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.pane-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.pane-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; padding: 4px; text-align: left; color: var(--text); font: inherit; cursor: pointer; border-radius: 8px; }
.pane-who:hover { background: var(--surface-2); }
.pane-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pane-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-back { display: none; }
.pane-main { flex: 1; display: flex; min-height: 0; }
.pane-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-chat .chat-body { flex: 1; }
.pane-info { width: 300px; border-left: 1px solid var(--border); overflow-y: auto; padding: 18px; background: var(--surface); flex: none; }
.info-head { text-align: center; margin-bottom: 16px; }
.info-head h3 { margin: 10px 0 4px; font-size: 16px; }
.info-avatar .chat-avatar { width: 88px; height: 88px; font-size: 26px; margin: 0 auto; }
.info-kv { grid-template-columns: 110px 1fr; font-size: 13px; margin-bottom: 16px; }
.info-actions > * + * { margin-top: 8px; }
.info-msg { margin: 12px 0 0; }
.danger-text { color: var(--red); }
.day-break { text-align: center; margin: 10px 0 4px; }
.day-break span { background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 12px; padding: 3px 12px; border-radius: 99px; box-shadow: var(--shadow); }
.chat-compose form { margin: 0; }
.compose-row { display: flex; align-items: flex-end; gap: 8px; }
.compose-row textarea { flex: 1; min-height: 40px; max-height: 160px; resize: none; border-radius: 20px; padding: 9px 16px; line-height: 1.4; }
.compose-attach { font-size: 18px; padding: 6px 8px; cursor: pointer; margin: 0; }
.compose-send { border-radius: 50%; width: 40px; height: 40px; padding: 0; flex: none; }
.compose-file { font-size: 12.5px; margin-top: 6px; cursor: pointer; }
.compose-error { margin: 8px 0 0; }
@media (max-width: 1100px) { .pane-info { position: absolute; right: 0; top: 0; bottom: 0; z-index: 5; box-shadow: -10px 0 30px rgba(0,0,0,.12); } .pane-main { position: relative; } }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 190px); }
  .inbox.has-chat .inbox-list { display: none; }
  .inbox:not(.has-chat) .inbox-pane { display: none; }
  .pane-back { display: inline-flex; }
  .pane-info { width: 100%; }
}

/* pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.pg-info { color: var(--muted); }
.pg-info strong { color: var(--text); }
.pg-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pg-links a, .pg-links span { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.pg-links a:hover { background: var(--surface-2); text-decoration: none; }
.pg-links .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 650; }
.pg-links .disabled { color: var(--muted); opacity: .45; }
.pg-links .gap { border: 0; background: none; min-width: 16px; padding: 0; color: var(--muted); }
.pg-per { color: var(--muted); display: flex; align-items: center; gap: 4px; }
.pg-per a { padding: 3px 8px; border-radius: 6px; color: var(--muted); }
.pg-per a.on { background: var(--brand-50); color: var(--brand-600); font-weight: 650; }
.pg-top .pagination { border-top: 0; border-bottom: 1px solid var(--border); }
.card > .pagination:only-child { border-top: 0; }
.bubble.pending { opacity: .75; }
.bubble.failed { background: var(--red-50); }
.bubble.failed .bubble-time { color: var(--red); }
.chat-loading { padding: 6px 0 12px; }

/* chat composer (WhatsApp Web style) */
.pane-chat { position: relative; }
.icon-btn { background: none; border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.compose-menu-wrap { position: relative; }
.attach-menu { position: absolute; bottom: 46px; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; min-width: 210px; z-index: 6; }
.attach-menu button { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 9px 10px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.attach-menu button:hover { background: var(--surface-2); }
.attach-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; }
.attach-ico.doc { background: #ede4ff; }
.attach-ico.media { background: #ffe4ef; }
.emoji-panel { position: absolute; bottom: 46px; left: 0; width: 320px; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; z-index: 6; }
.emoji-panel[hidden] { display: none; }
.emoji-panel button { background: none; border: 0; font-size: 22px; padding: 4px; border-radius: 6px; cursor: pointer; }
.emoji-panel button:hover { background: var(--surface-2); }
.compose-row { align-items: center; gap: 4px; }
.media-preview { position: absolute; inset: 0; background: var(--surface-2); display: flex; flex-direction: column; z-index: 7; }
.media-preview[hidden] { display: none; }
.mp-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mp-body { flex: 1; display: grid; place-items: center; padding: 20px; min-height: 0; }
.mp-body img, .mp-body video { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow); object-fit: contain; }
.mp-file { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px 36px; text-align: center; box-shadow: var(--shadow); max-width: 320px; }
.mp-file-ico { width: 70px; height: 84px; margin: 0 auto 12px; border-radius: 8px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; font-weight: 800; letter-spacing: .04em; }
.mp-file-name { font-weight: 600; word-break: break-all; margin-bottom: 4px; }
.mp-foot { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border); }
.mp-foot input { flex: 1; border-radius: 20px; padding: 10px 16px; }
.drop-hint { position: absolute; inset: 0; z-index: 8; background: rgba(18,161,80,.12); border: 3px dashed var(--brand); border-radius: 10px; display: grid; place-items: center; font-size: 18px; font-weight: 650; color: var(--brand-600); pointer-events: none; }
.drop-hint[hidden] { display: none; }
.tick { font-size: 11px; letter-spacing: -2px; margin-left: 2px; color: var(--muted); }
.tick-read { color: #34b7f1; }
.bubble .bubble-img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,14,18,.92); display: grid; place-items: center; padding: 50px 20px 20px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); border-radius: 6px; }
.lightbox-bar { position: absolute; top: 12px; right: 16px; display: flex; gap: 10px; }
.lightbox-bar a, .lightbox-bar button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 8px; padding: 7px 14px; font: inherit; cursor: pointer; }
.brand-logo { display: block; height: 34px; width: auto; max-width: 190px; object-fit: contain; }
.slim .brand-logo { height: 42px; max-width: 240px; }

/* monthly / yearly pricing */
[data-period-scope]:not(.period-yearly) .only-yearly, [data-period-scope].period-yearly .only-monthly { display: none !important; }
.period-switch { display: flex; width: max-content; max-width: 100%; margin: 0 auto 26px; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(18,161,80,.08); border: 1px solid rgba(18,161,80,.18); }
.period-switch button { border: 0; background: none; font: inherit; font-weight: 650; padding: 8px 18px; border-radius: 999px; cursor: pointer; color: inherit; opacity: .75; display: inline-flex; align-items: center; gap: 8px; }
.period-switch button.on { background: #12a150; color: #fff; opacity: 1; box-shadow: 0 2px 8px rgba(18,161,80,.3); }
.save-chip { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff3c4; color: #8a5a00; }
.period-switch button.on .save-chip { background: rgba(255,255,255,.22); color: #fff; }
.year-hint, .plan-year { display: block; font-size: 13px; color: #0e8a44; font-weight: 600; margin: 2px 0 6px; }
.plan-year.muted-y { color: inherit; opacity: .6; font-weight: 500; }
