/* Wappx — design tokens. Logical properties throughout so RTL (Arabic/Urdu) mirrors automatically. */
:root {
  --brand: #1565d8;
  --brand-600: #0f4fb3;
  --brand-50: #e7f1ff;
  --accent: #25d366;
  --ink: #0f2140;
  --ink-2: #3c5172;
  --muted: #6b7f9c;
  --line: #d9e7f7;
  --bg: #e4f2ff;
  --card: #ffffff;
  --danger: #c43d3d;
  --danger-50: #fdeeee;
  --warn: #a8620a;
  --warn-50: #fff4e2;
  --ok: #187a4c;
  --ok-50: #e6f6ee;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 60, 130, .06), 0 8px 24px rgba(21, 101, 216, .08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rtl: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Geeza Pro", Arial, sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", Tahoma, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); }
html[dir="rtl"] body { font-family: var(--font-rtl); }
html[lang="ur"] body { font-family: var(--font-ur); line-height: 1.9; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; color: var(--ink); }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small { display: block; font-size: .8rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .6em 1.05em; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93232; }
.btn-danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn-danger-ghost:hover { background: var(--danger-50); }
.btn-ghost { background: transparent; }
.btn-sm { padding: .38em .75em; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: transparent; font-size: 1.05rem; cursor: pointer; color: var(--ink-2); padding: .35rem .5rem; border-radius: 6px; line-height: 1; }
.icon-btn:hover { background: var(--bg); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; align-content: start; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="tel"], input[type="number"], input[type="datetime-local"], select {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid #cfd8d4; border-radius: var(--radius-sm); padding: .62em .8em; min-height: 42px;
}
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input:disabled { background: var(--bg); color: var(--muted); }
input.otp { letter-spacing: .4em; font-size: 1.25rem; text-align: center; font-family: ui-monospace, monospace; max-width: 220px; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--ink-2); }
.check input { margin-top: .25em; width: 18px; height: 18px; accent-color: var(--brand); }
.hint { font-size: .82rem; color: var(--muted); margin: 0; }
.field-error { color: var(--danger); font-size: .8rem; font-weight: 500; margin: 0; }
.form-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.form-row .grow, .grow { flex: 1 1 220px; }
.form-row.compact { align-items: center; margin-top: 1rem; }
.form-row.compact select { flex: 1 1 140px; min-height: 36px; padding: .4em .6em; }
.form-inline { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.form-inline input { flex: 1 1 140px; min-height: 34px; padding: .35em .6em; }
.form-actions { display: flex; justify-content: flex-end; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Alerts & badges ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .92rem; border: 1px solid; }
.alert-success { background: var(--ok-50); border-color: #bfe6d1; color: #0f5a37; }
.alert-error { background: var(--danger-50); border-color: #f2c4c4; color: #8c2424; }
.badge { display: inline-block; padding: .18em .6em; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--brand-50); color: var(--brand); white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-muted { background: #eef1f0; color: var(--muted); }
.soon { font-style: normal; font-size: .68rem; font-weight: 700; padding: .1em .5em; border-radius: 999px; background: #eef1f0; color: var(--muted); margin-inline-start: auto; }

/* ---------- Guest (auth) layout ---------- */
.guest-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; }
.guest-brand {
  background: radial-gradient(1200px 500px at -10% 110%, #138a72 0%, transparent 60%), linear-gradient(160deg, #0b6e5c, #064438);
  color: #e7f6f1; padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: center; gap: 1.5rem;
}
.guest-brand h2 { color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.3rem); max-width: 16ch; }
.brand-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.brand-points li { padding-inline-start: 1.8rem; position: relative; }
.brand-points li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--accent); font-weight: 800; }
.brand-foot { opacity: .7; font-size: .85rem; margin-top: 1rem; }
.brand-mark { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; color: inherit; text-decoration: none; }
.brand-mark:hover { text-decoration: none; }
.guest-brand .brand-mark { color: #fff; }
.brand-mark.small { font-size: 1.05rem; color: var(--ink); }
.guest-panel { display: flex; flex-direction: column; padding: 1.25rem clamp(1rem, 4vw, 3rem); }
.guest-top { display: flex; justify-content: space-between; align-items: center; }
.guest-top .brand-mark { visibility: hidden; }
.guest-card { width: 100%; max-width: 440px; margin: auto; padding: 2rem 0; }
.guest-card h1 { font-size: 1.75rem; }
.switch-line { margin-top: 1.5rem; text-align: center; color: var(--muted); }
.link-sm { font-size: .84rem; font-weight: 600; }
.resend { margin-top: 1rem; font-size: .88rem; color: var(--muted); }
.resend summary { cursor: pointer; text-align: center; }
.resend .form-inline { margin-top: .75rem; }
.center-block { text-align: center; }
.center-block .form { margin-top: 1.25rem; }
.big-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-size: 1.7rem; margin: 0 auto 1rem; }

/* ---------- Language switch ---------- */
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--card); }
.lang-switch a { padding: .25em .75em; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.lang-switch a.is-active { background: var(--brand); color: #fff; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #0d1f1b; color: #c9d8d3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.1rem .6rem; }
.sidebar .brand-mark { color: #fff; }
.ws-switch { padding: .3rem 1rem .6rem; }
.ws-switch select { background: #16302a; color: #fff; border-color: #24443b; min-height: 38px; font-weight: 600; }
.nav { display: grid; gap: 2px; padding: .25rem .6rem 1rem; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7f968f; margin: 1rem .6rem .35rem; font-weight: 700; }
html[dir="rtl"] .nav-label { letter-spacing: 0; text-transform: none; }
.nav-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 8px; color: #c9d8d3; font-weight: 600; font-size: .92rem; text-decoration: none; }
.nav-item:hover { background: #16302a; color: #fff; text-decoration: none; }
.nav-item.is-active { background: var(--brand); color: #fff; }
.nav-item.is-disabled { opacity: .5; cursor: default; }
.nav-item.is-disabled:hover { background: transparent; color: #c9d8d3; }
.nav-item .ico { width: 1.2rem; text-align: center; opacity: .85; }
.sidebar-foot { margin-top: auto; padding: 1rem; border-top: 1px solid #1d3a33; display: grid; gap: .75rem; }
.sidebar-foot .btn { color: #c9d8d3; border-color: #24443b; }
.sidebar-foot .btn:hover { background: #16302a; color: #fff; }
.me { display: flex; align-items: center; gap: .7rem; }
.me-text strong { color: #fff; font-size: .9rem; display: block; }
.me-text small { color: #8ea59e; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; background: var(--brand-50); color: var(--brand); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .8rem clamp(1rem, 3vw, 2rem); background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-title { flex: 1; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.ws-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: clamp(1rem, 3vw, 2rem); max-width: 1180px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.page-head p { margin: 0; }
.only-mobile { display: none; }
.scrim { display: none; }

/* ---------- Cards, stats, lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-flat { box-shadow: none; }
pre { white-space: pre-wrap; margin: 0; }
.card-accent { background: linear-gradient(140deg, var(--brand-50), #fff); border-color: #cfe7df; }
.card-danger { border-color: #f0d0d0; }
.stack { display: grid; gap: 1rem; align-content: start; }
.stack > .card { margin-bottom: 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: grid; gap: .2rem; color: var(--ink); box-shadow: var(--shadow); text-decoration: none; }
a.stat:hover { border-color: #bcd9cf; text-decoration: none; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.75rem; font-weight: 800; }
.stat-value.small { font-size: 1rem; padding-top: .45rem; }
.stat-muted .stat-value { color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; counter-reset: s; }
.checklist li { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); counter-increment: s; }
.checklist li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cfd8d4; display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--muted); flex: none; }
.checklist li.done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: #fff; }
.checklist li.done { color: var(--muted); }
.checklist li.done a { color: var(--muted); }
.checklist li.pending { color: var(--muted); }
.list, .people, .timeline { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; }
.list li, .people li, .timeline li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child, .people li:last-child, .timeline li:last-child { border-bottom: 0; }
.people li { justify-content: flex-start; }
.people li .push { margin-inline-start: auto; }
.timeline li { flex-direction: column; align-items: flex-start; gap: 0; }
.person { display: flex; gap: .7rem; align-items: center; }
.empty-state { text-align: center; padding: 2rem 1rem; }
.empty-state.compact { padding: 1rem; }
.error-state { padding: 4rem 1rem; }
.error-code { font-size: 3.5rem; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; }
.steps { padding-inline-start: 1.2rem; display: grid; gap: .6rem; }
.secret-box { display: flex; gap: .5rem; align-items: center; margin: .5rem 0; flex-wrap: wrap; }
.secret-box code { background: var(--bg); border: 1px dashed #c6d3ce; padding: .5rem .75rem; border-radius: 6px; font-size: 1rem; letter-spacing: .05em; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.team-grid .card { margin: 0; }
.team-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.role-help { margin-top: 1rem; font-size: .9rem; }
.role-help summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.role-help dt { font-weight: 700; margin-top: .6rem; }
.role-help dd { margin: 0; color: var(--ink-2); }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: start; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
html[dir="rtl"] .table th { text-transform: none; letter-spacing: 0; }
.table td { padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { text-align: end; white-space: nowrap; }
.table td small { margin-top: .1rem; }
.perm-table tr.is-locked td { opacity: .55; }
.perm-table select { min-height: 34px; padding: .3em .5em; max-width: 170px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .guest-wrap { grid-template-columns: 1fr; }
  .guest-brand { display: none; }
  .guest-top .brand-mark { visibility: visible; }
  .shell { grid-template-columns: 1fr; }
  .only-mobile { display: inline-flex; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(290px, 86vw); z-index: 30; transform: translateX(-105%); transition: transform .22s ease; }
  html[dir="rtl"] .sidebar { transform: translateX(105%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 20, 17, .45); z-index: 20; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .content { padding: 1rem; }
  .page-head { flex-direction: column; }
  .lang-switch a { padding: .25em .55em; }
  /* Tables become stacked cards on phones */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .75rem; padding: .25rem .5rem; }
  .table td { border: 0; padding: .45rem .25rem; display: flex; justify-content: space-between; gap: 1rem; text-align: end; }
  .table td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: .78rem; text-align: start; }
  .table td.actions { justify-content: flex-end; }
  .table td.actions::before { content: none; }
  .table td > .person { text-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Module 2: plans, billing, settings ---------- */
.alert-warn { background: var(--warn-50); border-color: #f1d3a3; color: #7a4708; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.alert-warn a { color: #7a4708; font-weight: 700; }
textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd8d4; border-radius: var(--radius-sm); padding: .62em .8em; resize: vertical; }
textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input[type="date"] { width: 100%; font: inherit; border: 1px solid #cfd8d4; border-radius: var(--radius-sm); padding: .55em .8em; min-height: 42px; background: #fff; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; margin: 0; }
.fieldset legend { font-weight: 700; font-size: .9rem; padding: 0 .4rem; }
.checks { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.check.small { font-size: .8rem; font-weight: 400; }
.form-actions.gap { gap: .6rem; }
.top-gap { margin-top: 1rem; }
.section-title { margin: 1.5rem 0 .75rem; }
.sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .5rem; }
.sub-plan { font-size: 1.2rem; }
.usage { display: grid; gap: .45rem; margin-top: .75rem; }
.usage-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.bar { height: 8px; background: #edf1ef; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; }
.bar-ok { background: var(--brand); } .bar-warn { background: #d48a1c; } .bar-full { background: var(--danger); }
.w-0 { width: 0%; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; } 
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.plan-card { margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.plan-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.plan-price { font-size: 1.35rem; font-weight: 800; margin: 0; }
.feature-list { list-style: none; padding: 0; margin: .25rem 0 .75rem; display: grid; gap: .35rem; font-size: .9rem; }
.feature-list li { padding-inline-start: 1.4rem; position: relative; }
.feature-list li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--brand); font-weight: 800; }

.field .hint, .field .check { font-weight: 400; }

.plan-actions { margin-top: auto; display: grid; gap: .5rem; }

/* ---------- Contacts ---------- */
.head-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.chip { display: inline-block; padding: .12em .55em; margin: 0 .25em .25em 0; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
html[dir="rtl"] .chip { margin: 0 0 .25em .25em; }
.chip-green { background: #e3f4ec; color: #136c45; } .chip-blue { background: #e4eefc; color: #1d4f9c; }
.chip-amber { background: #fdf0d9; color: #8a5304; } .chip-red { background: #fde6e6; color: #9b2c2c; }
.chip-purple { background: #efe7fb; color: #5b2ea6; } .chip-gray { background: #eef1f0; color: #4a5a55; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--line); margin-bottom: .25rem; }
.bulk-bar select { width: auto; min-height: 36px; padding: .35em .6em; }
.check-col { width: 36px; }
.check-col input { width: 18px; height: 18px; accent-color: var(--brand); }
.filters { margin-top: 0; }
.tag-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-option { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.tag-option input { accent-color: var(--brand); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 1rem; }
.sample { background: var(--bg); border: 1px dashed #c6d3ce; border-radius: 6px; padding: .75rem; overflow-x: auto; }
.note-body { white-space: normal; word-break: break-word; }
input[type="tel"], input[type="file"] { width: 100%; font: inherit; border: 1px solid #cfd8d4; border-radius: var(--radius-sm); padding: .55em .8em; min-height: 42px; background: #fff; }

/* ---- WhatsApp connection ---- */
.badge-danger { background: var(--danger-50); color: #8c2424; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.card-head p { margin: .2rem 0 0; }
.badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.card-muted { background: var(--bg); }
form.inline { display: inline-flex; margin: 0; }
.tool-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-start; }
.tool-row .push-end { margin-inline-start: auto; }
details.tool { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .35rem .7rem; background: #fff; }
details.tool[open] { flex: 1 1 280px; }
details.tool summary, details > summary { cursor: pointer; font-weight: 600; font-size: .88rem; }
details.tool .form-row, details.tool .form { margin-top: .6rem; }
details.tool .hint { margin: .4rem 0 0; }
.table tr.sub-row td { padding-top: 0; border-top: 0; }
.fieldset h3 { margin: 0 0 .25rem; font-size: .95rem; }
.secret-box code { word-break: break-all; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.fieldset .secret-box code { font-size: .85rem; letter-spacing: 0; }
.table td strong[dir="ltr"] { white-space: nowrap; }

/* ---------- Inbox ---------- */
.inbox { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 1rem; height: calc(100vh - 150px); min-height: 520px; }
.inbox .card { margin: 0; padding: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.inbox-list-head { padding: 1rem 1rem .5rem; border-bottom: 1px solid var(--line); display: grid; gap: .6rem; }
.inbox-list-head h1 { font-size: 1.25rem; margin: 0; }
.inbox-search input { min-height: 36px; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs a { padding: .3rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.tabs a:hover { background: var(--bg); }
.tabs a.on { background: var(--brand-50); color: var(--brand); }
.tabs a b { font-weight: 700; color: var(--brand); }
.tabs-sm a { font-size: .76rem; padding: .2rem .55rem; }
.conv-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.conv { display: flex; gap: .65rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.conv:hover { background: var(--bg); text-decoration: none; }
.conv.active { background: var(--brand-50); }
.conv-main { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.conv-top, .conv-bottom, .conv-tags { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.conv-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.conv-top small { color: var(--muted); flex: none; font-size: .75rem; }
.conv-preview { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .conv-preview { color: var(--ink); font-weight: 600; }
.conv-tags { justify-content: flex-start; font-size: .75rem; color: var(--ink-2); }
.pill { background: var(--brand); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: .05rem .45rem; flex: none; }
.center { text-align: center; }

.thread-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.thread-who { flex: 1; min-width: 160px; display: grid; }
.thread-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.thread-actions select { min-height: 32px; padding: .2em .5em; font-size: .82rem; width: auto; }
.thread-back { display: none; font-size: 1.2rem; text-decoration: none; }
.thread-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .45rem;
  background: #efeae2 linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.55)); }
.msg { max-width: min(78%, 560px); padding: .45rem .7rem .3rem; border-radius: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.06); background: #fff; align-self: flex-start; word-wrap: break-word; }
.msg-out { align-self: flex-end; background: #d9fdd3; }
.msg-note { align-self: center; background: #fff7d6; border: 1px dashed #e6cf7a; max-width: 85%; }
.msg-label { font-size: .72rem; font-weight: 700; color: #8a6d00; margin-bottom: .15rem; }
.msg-body { font-size: .92rem; line-height: 1.45; white-space: normal; }
.msg-meta { display: flex; justify-content: flex-end; gap: .35rem; align-items: center; font-size: .7rem; color: var(--muted); margin-top: .15rem; }
.msg-img { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; }
.msg-img.sticker { max-height: 140px; background: transparent; }
.msg audio { max-width: 260px; }
.msg-file { display: inline-block; padding: .4rem .6rem; background: rgba(0,0,0,.04); border-radius: 6px; font-weight: 600; }
.msg-system { align-self: center; font-size: .74rem; color: var(--ink-2); background: rgba(255,255,255,.85); padding: .2rem .7rem; border-radius: 999px; }
.tick { color: #8696a0; letter-spacing: -.15em; font-weight: 700; }
.tick-read { color: #53bdeb; }
.tick-failed { color: var(--danger); letter-spacing: 0; }
.msg-error { color: var(--danger); font-size: .72rem; display: block; max-width: 260px; }
.composer { border-top: 1px solid var(--line); padding: .7rem 1rem; display: grid; gap: .45rem; background: var(--card); }
.composer textarea { resize: vertical; min-height: 54px; max-height: 200px; }
.composer-actions { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; }
.composer-actions .hint { margin-inline-end: auto; }
.composer-note { margin: 0; font-size: .82rem; color: #8a6d00; background: #fff7d6; padding: .45rem .7rem; border-radius: 6px; }
section.inbox-thread > .composer-note { margin: .7rem 1rem; }
.inbox-thread .empty-state { margin: auto; }

@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 120px); }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .inbox-thread { display: none; }
  .thread-back { display: inline-block; }
  .msg { max-width: 88%; }
  .composer-actions .hint { display: none; }
}
.nav-pill { margin-inline-start: auto; font-style: normal; }
.conv-bottom .conv-preview { min-width: 0; flex: 1; }
.inbox { height: calc(100dvh - 200px); }
@media (max-width: 860px) { .inbox { height: calc(100dvh - 190px); min-height: 460px; } }

/* ---------- Templates ---------- */
.bottom-gap { margin-bottom: 1rem; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.tpl-card { margin: 0; display: grid; gap: .6rem; }
.tpl-card p { margin: 0; }
.tpl-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.tpl-head strong { overflow-wrap: anywhere; }
.wa-preview { background: #efeae2; border-radius: 10px; padding: .8rem; display: grid; gap: 4px; }
.wa-bubble { background: #fff; border-radius: 8px; padding: .5rem .7rem; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.wa-header { font-weight: 700; margin-bottom: .25rem; }
.wa-header:empty, .wa-footer:empty { display: none; }
.wa-media { background: #d7dde0; border-radius: 6px; padding: 1.4rem .5rem; text-align: center; color: #54656f; font-size: .85rem; margin-bottom: .35rem; }
.wa-footer { color: #8696a0; font-size: .78rem; margin-top: .3rem; }
.wa-button { background: #fff; border-radius: 8px; text-align: center; color: #027eb5; font-weight: 600; font-size: .86rem; padding: .45rem; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.var { background: #e0f2ee; color: var(--brand); border-radius: 4px; padding: 0 .2em; font-family: ui-monospace, monospace; font-size: .85em; }
.btn-row { display: grid; grid-template-columns: 150px 1fr 1fr 1fr; gap: .4rem; margin-bottom: .4rem; }
.sticky-card { position: sticky; top: 80px; }
.tpl-send { border-top: 1px solid var(--line); padding: .55rem 1rem; background: var(--card); }
.tpl-send summary { font-size: .85rem; }
.tpl-send .form-row { margin-top: .5rem; }
.tpl-send-grid { display: grid; grid-template-columns: 1fr minmax(200px, 300px); gap: 1rem; margin-top: .6rem; align-items: start; max-height: 42vh; overflow-y: auto; }
.msg-label-tpl { color: var(--brand); }
@media (max-width: 860px) {
  .btn-row { grid-template-columns: 1fr 1fr; }
  .tpl-send-grid { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
}
.tpl-send[open] { max-height: 58vh; overflow-y: auto; }
.tpl-send-grid { max-height: none; overflow: visible; }
.composer-switch { margin: .5rem 1rem; background: transparent; }
.field > span small { display: inline; font-weight: 400; }
.thread-body { min-height: 120px; }

/* ---------- Broadcasts ---------- */
.progress { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .4s ease; }
.var-row { display: grid; grid-template-columns: minmax(140px, 1fr) 170px 2fr; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.var-row .field-error { grid-column: 1 / -1; }
.var-label { font-weight: 600; font-size: .86rem; color: var(--ink-2); }
.var-label code, .var-label { overflow-wrap: anywhere; }
@media (max-width: 860px) { .var-row { grid-template-columns: 1fr; } }
.ai-tag { color: #7a4fd6; font-weight: 700; }

/* ---------- Analytics ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .bar-in { fill: #9ad3c4; }
.chart .bar-out { fill: var(--brand); }
.legend { font-size: .8rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; margin: .5rem 0 0; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw-in { background: #9ad3c4; }
.sw-out { background: var(--brand); margin-inline-start: .8rem; }
.chart { direction: ltr; }


/* =====================================================================
   Wappx blue glossy theme
   Sky-blue glossy background · blue glossy header and sidebar · white glossy cards
   ===================================================================== */
body.app {
  background: radial-gradient(1200px 600px at 85% -10%, rgba(255,255,255,.85), transparent 60%),
              linear-gradient(165deg, #d9eeff 0%, #bfe1ff 38%, #dff1ff 70%, #f1f9ff 100%) fixed;
}
/* Sidebar: deep blue glass */
.sidebar {
  background: linear-gradient(180deg, #0d4bb5 0%, #0a3a8f 45%, #082c6e 100%);
  color: #d9e8ff; box-shadow: 4px 0 24px rgba(8, 44, 110, .18);
}
.sidebar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 140px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0)); }
.nav-label { color: #9fc0f2; }
.nav-item { color: #e3eeff; }
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.is-active { background: linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,.14)); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 12px rgba(0,0,0,.12); }
.nav-item.is-disabled:hover { color: #e3eeff; }
.ws-switch select { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.28); }
.ws-switch select option { color: #0f2140; }
.sidebar-foot { border-top-color: rgba(255,255,255,.16); }
.sidebar-foot .btn { color: #e3eeff; border-color: rgba(255,255,255,.3); background: transparent; }
.sidebar-foot .btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.me-text small { color: #a9c6f3; }
.sidebar .avatar { background: linear-gradient(180deg, #ffffff, #d7e8ff); color: #0d4bb5; }
.nav-pill { background: #fff; color: #0d4bb5; }

/* Header: glossy blue bar */
.topbar {
  background: linear-gradient(180deg, #3b8cf2 0%, #1d6fe0 48%, #1559c4 52%, #1765d4 100%);
  border-bottom: 1px solid rgba(8, 44, 110, .25); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 18px rgba(21, 101, 216, .25);
}
.topbar .ws-name { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.topbar .icon-btn { color: #fff; }
.topbar .lang-switch { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); }
.topbar .lang-switch a { color: #eaf3ff; }
.topbar .lang-switch a.is-active { background: #fff; color: #1559c4; box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* Cards: white glossy panels */
.card, .stat {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(246,251,255,.96) 100%);
  border: 1px solid rgba(255,255,255,.9); border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 0 0 1px rgba(21,101,216,.08), 0 10px 28px rgba(21,101,216,.10);
}
.card h2, .card-head h2 { color: #0d3d8f; }
.card-accent { background: linear-gradient(140deg, #eaf4ff, #ffffff); border-color: #cfe3fb; }
.card-danger { border-color: #f4caca; }
.page-head h1 { color: #0b2f6e; }
.table th { background: linear-gradient(180deg, #f3f8ff, #e8f1fd); color: #3c5f96; }
.table tr:hover td { background: rgba(21,101,216,.03); }
.btn-primary { background: linear-gradient(180deg, #3b8cf2 0%, #1d6fe0 50%, #1559c4 100%); border-color: #1559c4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 10px rgba(21,101,216,.25); }
.btn-primary:hover { background: linear-gradient(180deg, #4797f5 0%, #2479e8 50%, #165fcf 100%); }
.btn-light { background: rgba(255,255,255,.92); color: #0d4bb5; border-color: rgba(255,255,255,.95); font-weight: 700; }
.btn-light:hover { background: #fff; }
.tabs a.on { background: linear-gradient(180deg, #e8f2ff, #d6e8ff); color: #0d4bb5; box-shadow: inset 0 0 0 1px #c4dcfb; }
.badge { background: #e3efff; color: #0d4bb5; }
.checklist li { background: rgba(255,255,255,.7); border-color: #d9e7f7; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="tel"], input[type="number"], input[type="datetime-local"], select, textarea {
  border-color: #c9dcf3; background: #fff; }
.avatar { background: linear-gradient(180deg, #3b8cf2, #1559c4); }
.avatar.sm { background: #e3efff; color: #0d4bb5; }

/* Hero banner */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; flex-wrap: wrap; color: #fff;
  padding: 1.4rem 1.6rem; border-radius: 18px; margin-bottom: 1.1rem; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1d6fe0 0%, #0d4bb5 55%, #0a3a8f 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 30px rgba(13, 75, 181, .28); }
.hero::after { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0)); pointer-events: none; }
.hero h1 { margin: .1rem 0 .2rem; color: #fff; font-size: 1.6rem; }
.hero p { margin: 0; color: #d8e8ff; }
.hero .hero-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: #a9cbff; }
html[dir="rtl"] .hero .hero-kicker { letter-spacing: 0; }
.hero-actions { display: flex; gap: .5rem; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-admin { background: linear-gradient(135deg, #3b2fc9 0%, #1d4fc4 55%, #0a3a8f 100%); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.kpi { position: relative; display: grid; gap: .15rem; padding: 1rem 1.1rem; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f2f8ff 100%); border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(21,101,216,.08), 0 10px 26px rgba(21,101,216,.10); }
a.kpi:hover { box-shadow: 0 0 0 1px rgba(21,101,216,.25), 0 12px 28px rgba(21,101,216,.16); text-decoration: none; }
.kpi-ico { position: absolute; inset-inline-end: .9rem; top: .8rem; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(180deg, #e8f2ff, #d3e6ff); font-size: .95rem; }
.kpi-label { font-size: .78rem; font-weight: 700; color: #5a74a0; }
.kpi-value { font-size: 1.8rem; font-weight: 800; color: #0b2f6e; line-height: 1.15; }
.kpi-small { font-size: 1.15rem; padding-top: .35rem; }
.kpi small { color: var(--muted); font-size: .76rem; }

/* Dashboard bits */
.announce { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 14px; margin-bottom: 1rem; text-decoration: none; color: var(--ink);
  background: linear-gradient(180deg, #fffdf3, #fff6d9); border: 1px solid #f4dd94; box-shadow: 0 6px 18px rgba(168, 98, 10, .10); }
.announce.lvl-success { background: linear-gradient(180deg, #f2fff8, #dcf7ea); border-color: #a9e2c4; }
.announce.lvl-info { background: linear-gradient(180deg, #f4f9ff, #e2efff); border-color: #bcd6f7; }
.announce span { display: grid; gap: .15rem; }
.announce-ico { font-size: 1.3rem; }
.mini-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; align-items: end; height: 150px; padding-top: .5rem; }
.mini-day { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: .3rem; text-align: center; }
.mini-day small { color: var(--muted); font-size: .72rem; }
.mini-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
.mini-bars span { width: 40%; max-width: 16px; border-radius: 5px 5px 2px 2px; min-height: 2px; }
.mb-in { background: linear-gradient(180deg, #9fd0ff, #6fb2ff); }
.mb-out { background: linear-gradient(180deg, #3b8cf2, #1559c4); }
.sw-in, .chart .bar-in { background: #8cc4ff; fill: #8cc4ff; }
.sw-out, .chart .bar-out { background: var(--brand); fill: var(--brand); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; }
.tile { display: grid; gap: .1rem; padding: .8rem; border-radius: 12px; text-decoration: none; color: var(--ink); text-align: center;
  background: linear-gradient(180deg, #f6faff, #e9f2ff); border: 1px solid #d6e6fa; }
.tile strong { font-size: 1.5rem; color: #0d4bb5; }
.tile span { font-size: .8rem; color: var(--muted); }
.tile:hover { text-decoration: none; border-color: #9cc3f5; }

/* Notifications bell */
.bell { position: relative; }
.bell summary { list-style: none; cursor: pointer; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); }
.bell summary::-webkit-details-marker { display: none; }
.bell-ico { font-size: 1.05rem; }
.bell-count { position: absolute; top: -4px; inset-inline-end: -4px; background: #ff4d4f; color: #fff; font-size: .68rem; font-weight: 800; border-radius: 999px;
  padding: .05rem .35rem; border: 2px solid #1d6fe0; }
.bell-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: min(360px, 92vw); max-height: 70vh; overflow-y: auto; z-index: 40;
  background: #fff; color: var(--ink); border-radius: 14px; box-shadow: 0 18px 50px rgba(8,44,110,.25); border: 1px solid #d9e7f7; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.bell-item { display: grid; gap: .15rem; padding: .65rem 1rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.bell-item:hover { background: #f4f9ff; text-decoration: none; }
.bell-item.unread { background: #eef5ff; border-inline-start: 3px solid var(--brand); }
.bell-title { font-weight: 600; font-size: .88rem; }
.bell-body { font-size: .8rem; color: var(--ink-2); }
.bell-empty { padding: 1rem; margin: 0; }
.bell-all { display: block; text-align: center; padding: .6rem; font-weight: 600; font-size: .85rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--line); }
.notif-list li > a, .notif-list li > div { display: grid; gap: .2rem; padding: .8rem .4rem; text-decoration: none; color: var(--ink); }
.notif-list li.unread { background: #eef5ff; }
.notif-list li.lvl-warning strong::before { content: "⚠ "; }
.notif-list li.lvl-success strong::before { content: "✓ "; color: var(--ok); }
.notif-body { color: var(--ink-2); font-size: .88rem; }

/* Menus, dialogs, row actions */
.row-actions { display: inline-flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; background: #fff; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(8,44,110,.2); border: 1px solid var(--line); padding: .3rem; }
.menu-item { display: block; width: 100%; text-align: start; background: none; border: 0; padding: .55rem .7rem; border-radius: 8px; font: inherit; font-size: .88rem; cursor: pointer; color: var(--ink); }
.menu-item:hover { background: #eef5ff; }
dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(860px, 94vw); max-height: 88vh; box-shadow: 0 30px 80px rgba(8,44,110,.35); }
dialog.modal::backdrop { background: rgba(8, 30, 70, .45); backdrop-filter: blur(2px); }
.modal-body { padding: 0; max-height: 88vh; overflow-y: auto; background: linear-gradient(180deg, #ffffff, #f4f9ff); }
.summary-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: 1.1rem 1.3rem; color: #fff;
  background: linear-gradient(135deg, #1d6fe0, #0a3a8f); position: sticky; top: 0; z-index: 2; }
.summary-head h2 { margin: 0; color: #fff; }
.summary-head p { margin: .2rem 0 0; color: #d8e8ff; }
.summary-head .icon-btn { color: #fff; }
.summary-sec { padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); }
.summary-sec h3 { margin: 0 0 .6rem; font-size: .95rem; color: #0d3d8f; }
.summary-foot { padding: 1rem 1.3rem; margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem 1rem; margin: 0; }
.facts > div { background: #fff; border: 1px solid var(--border, #dbe7f7); border-radius: 10px; padding: .55rem .75rem; }
.facts dt { font-size: .75rem; margin-bottom: .15rem; color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; font-weight: 600; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 120px; gap: .7rem; align-items: center; margin-bottom: .45rem; font-size: .88rem; }
.funnel-bar { height: 14px; background: #e6eef9; border-radius: 999px; overflow: hidden; }
.funnel-bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .5s ease; }
.f-all { background: #9fc6f5; } .f-sent { background: #5aa0f0; } .f-del { background: #2f80ed; } .f-read { background: #1559c4; } .f-rep { background: #20b26b; }
.funnel-row strong small { color: var(--muted); font-weight: 600; }
.timeline-bars { display: flex; gap: 4px; align-items: flex-end; height: 120px; overflow-x: auto; }
.tb { display: grid; grid-template-rows: 1fr auto; height: 100%; min-width: 26px; text-align: center; }
.tb span { align-self: end; background: linear-gradient(180deg, #3b8cf2, #1559c4); border-radius: 4px 4px 1px 1px; }
.tb small { font-size: .62rem; color: var(--muted); }
@media (max-width: 640px) { .funnel-row { grid-template-columns: 1fr; } }

/* Templates grid: 5 per row on wide screens */
.toolbar-card { display: grid; gap: .6rem; }
.tpl-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; }
@media (max-width: 1600px) { .tpl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1280px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl-card { padding: .9rem; gap: .5rem; align-content: start; }
.tpl-head strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-meta { display: flex; gap: .3rem; flex-wrap: wrap; }
.tpl-meta .chip { font-size: .7rem; }
.clamp { max-height: 210px; overflow: hidden; position: relative; }
.clamp::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40px; background: linear-gradient(180deg, rgba(239,234,226,0), #efeae2); pointer-events: none; border-radius: 0 0 10px 10px; }
.clamp.open { max-height: none; }
.clamp.open::after { display: none; }
.more-btn { justify-self: start; }
.tpl-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; }

/* Inbox polish */
.inbox.has-thread { grid-template-columns: minmax(270px, 330px) 1fr; }
.inbox-side { display: none; }
@media (min-width: 1360px) {
  .inbox.has-thread { grid-template-columns: minmax(270px, 320px) 1fr 270px; }
  .inbox-side { display: flex; flex-direction: column; gap: .8rem; padding: 1rem !important; overflow-y: auto; }
}
.side-top { display: grid; justify-items: center; gap: .3rem; text-align: center; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }
.side-facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem .7rem; margin: 0; font-size: .84rem; }
.side-facts dt { color: var(--muted); }
.side-facts dd { margin: 0; text-align: end; font-weight: 600; overflow-wrap: anywhere; }
.side-tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.btn-block { width: 100%; justify-content: center; }
.inbox-list-head { background: linear-gradient(180deg, #f6faff, #ffffff); }
.conv.active { background: linear-gradient(90deg, #e3efff, #f3f8ff); box-shadow: inset 3px 0 0 var(--brand); }
html[dir="rtl"] .conv.active { box-shadow: inset -3px 0 0 var(--brand); }
.thread-head { background: linear-gradient(180deg, #ffffff, #f4f9ff); }
.thread-body { background: #eaf3fb linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.5)); }
.msg { border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 50, 100, .10); }
.msg-in { border-start-start-radius: 4px; }
.msg-out { border-start-end-radius: 4px; background: #d6ecff; }
.day-sep { align-self: center; margin: .4rem 0; }
.day-sep span { background: rgba(255,255,255,.95); color: #4c6894; font-size: .72rem; font-weight: 700; padding: .2rem .7rem; border-radius: 999px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.av-0 { background: #e3efff !important; color: #0d4bb5 !important; } .av-1 { background: #e5f8ef !important; color: #187a4c !important; }
.av-2 { background: #fdf0d9 !important; color: #8a5304 !important; } .av-3 { background: #efe7fb !important; color: #5b2ea6 !important; }
.av-4 { background: #fde6e6 !important; color: #9b2c2c !important; } .av-5 { background: #e0f6fa !important; color: #0e6f80 !important; }
.composer { background: linear-gradient(180deg, #ffffff, #f6faff); }

/* ===== Inbox fills the whole screen (no empty space around it) ===== */
.content:has(> .inbox) { max-width: none; padding: .75rem .9rem; }
.main:has(> .content > .inbox) { height: 100vh; height: 100dvh; overflow-y: auto; }
.main:has(> .content > .inbox) > .content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.content > .inbox { flex: 1; height: auto; min-height: 420px; gap: .75rem; }
.conv-list { overflow-x: hidden; }
.conv-main { grid-template-columns: minmax(0, 1fr); }
.conv-main > * { min-width: 0; }
@media (min-width: 1360px) { .inbox.has-thread { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) 300px; } }
@media (min-width: 1700px) { .inbox.has-thread { grid-template-columns: 380px minmax(0, 1fr) 340px; } }

/* ===== Composer: attachments, voice notes, short window hint ===== */
.composer-actions { flex-wrap: wrap; }
.composer-actions .btn-icon { font-size: 1.05rem; padding-inline: .6rem; cursor: pointer; }
.btn-icon.recording { background: #fde8e8; color: #c62828; border-color: #f2b8b8; font-size: .85rem; font-weight: 700; animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { box-shadow: 0 0 0 4px rgba(198, 40, 40, .15); } }
.attach-chip { display: inline-flex; align-items: center; gap: .45rem; justify-self: start; max-width: 100%; background: #eaf3ff; border: 1px solid #cfe0f7; color: #1559c4; border-radius: 999px; padding: .2rem .3rem .2rem .75rem; font-size: .82rem; font-weight: 600; }
.attach-chip[hidden] { display: none; }
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-clear { border: 0; background: #fff; border-radius: 50%; width: 22px; height: 22px; line-height: 1; cursor: pointer; color: #4a5a70; flex: none; }
.composer-hint { margin: 0; font-size: .75rem; color: #8a6d00; text-align: end; }
html[dir="rtl"] .composer-hint { text-align: start; }

/* ===== Media in messages ===== */
.msg audio { display: block; width: 280px; max-width: 100%; height: 40px; }
.msg video.msg-img { background: #000; max-height: 360px; }
.msg-file { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; background: rgba(21, 101, 216, .06); border: 1px solid rgba(21, 101, 216, .15); border-radius: 10px; font-weight: 600; color: var(--ink); text-decoration: none; min-width: 200px; }
.msg-file:hover { text-decoration: none; background: rgba(21, 101, 216, .1); }
.msg-file .file-ico { font-size: 1.6rem; line-height: 1; }
.msg-file .file-info { display: grid; min-width: 0; }
.msg-file .file-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file small { color: var(--brand); font-weight: 600; font-size: .74rem; }
.msg-voice-tag { font-size: .72rem; color: var(--muted); display: block; margin-bottom: .2rem; }

/* ===== Template header file ===== */
.media-field { display: grid; gap: .3rem; }
.link-alt summary { cursor: pointer; font-size: .82rem; color: var(--brand); font-weight: 600; }
.link-alt[open] summary { margin-bottom: .4rem; }
.callout { border-radius: 12px; padding: .8rem 1rem; margin-top: .8rem; font-size: .88rem; }
.callout ul { margin: .4rem 0 0; padding-inline-start: 1.1rem; display: grid; gap: .25rem; }
.callout-info { background: #eef6ff; border: 1px solid #cfe2fb; color: #183b6b; }

.msg-img { max-width: min(100%, 340px); object-fit: cover; }
.msg video.msg-img { max-width: min(100%, 380px); }

/* ===== Admin help desk ===== */
.help-thread { display: grid; gap: 12px; }
.help-msg { border: 1px solid var(--line, #d9e6f7); border-radius: 14px; padding: 12px 14px; background: #fff; max-width: 88%; }
.help-msg.is-staff { justify-self: end; background: #e8f2ff; border-color: #bcd8fb; }
.help-msg-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

.guest-links { text-align: center; font-size: .82rem; margin-top: 18px; color: var(--muted, #6b7a93); }
.guest-links a { color: inherit; }

.facts dd { overflow-wrap: anywhere; }

/* Billing hand-off to Ziina */
.pay-handoff { max-width: 560px; margin: 60px auto; text-align: center; padding: 40px 32px; }
.pay-handoff h1 { font-size: 1.5rem; margin: 18px 0 8px; }
.pay-spinner { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; border: 5px solid #d6e6fb; border-top-color: var(--brand, #1565d8); animation: pay-spin .9s linear infinite; }
@keyframes pay-spin { to { transform: rotate(360deg); } }

/* Billing: unfinished payment notice and "Pay again" */
.pay-open { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 18px; border-radius: 14px; background: #fff8e6; border: 1px solid #fde7b0; animation: pay-in .4s ease both; }
.pay-open > div:nth-child(2) { flex: 1; min-width: 220px; }
.pay-open p { margin: 2px 0 0; color: #6b5200; }
.pay-open-ico { font-size: 1.6rem; }
.pay-open-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pay-open-actions form { margin: 0; }
.inline-form { display: inline; margin: 0; }
tr.is-highlight td { background: #fffbeb; }
@keyframes pay-in { from { opacity: 0; transform: translateY(-6px); } }

/* ===== Blog editor ===== */
.blog-editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.blog-side { display: grid; gap: 16px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding-bottom: 6px; }
.blog-side .card, .blog-main .card { margin: 0; }
.input-lg { font-size: 1.25rem !important; font-weight: 700; }
.slug-row { display: flex; align-items: center; gap: 4px; }
.slug-row input { flex: 1; }
.counter { font-weight: 600; color: var(--muted, #6b7a93); }
.counter.good { color: #15803d; } .counter.warn { color: #b45309; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line, #d9e6f7); border-bottom: 0; border-radius: 12px 12px 0 0; background: #f5f9ff; }
.md-toolbar button, .md-upload { border: 1px solid transparent; background: #fff; border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.md-toolbar button:hover, .md-upload:hover { border-color: var(--brand, #1565d8); color: var(--brand, #1565d8); }
.md-input { border-radius: 0 0 12px 12px !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; line-height: 1.6; min-height: 460px; }
.cover-box { aspect-ratio: 1200 / 630; border-radius: 12px; background: linear-gradient(135deg, #e3f0ff, #cfe4ff); display: grid; place-items: center; overflow: hidden; margin-bottom: 10px; font-size: 2rem; }
.cover-box img { width: 100%; height: 100%; object-fit: cover; }
.seo-card h2 { display: flex; justify-content: space-between; align-items: center; }
.seo-score { font-size: .85rem; padding: .2em .7em; border-radius: 999px; background: #eef1f0; }
.seo-score.good { background: #dcfce7; color: #166534; } .seo-score.mid { background: #fef3c7; color: #92400e; } .seo-score.low { background: #fee2e2; color: #991b1b; }
.serp { border: 1px solid var(--line, #d9e6f7); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; margin: 6px 0 12px; background: #fff; font-family: Arial, sans-serif; }
.serp-url { color: #4d5156; font-size: .78rem; }
.serp-title { color: #1a0dab; font-size: 1.05rem; font-weight: 400; line-height: 1.3; }
.serp-desc { color: #4d5156; font-size: .84rem; line-height: 1.45; }
.seo-checks { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; font-size: .86rem; }
.seo-checks li { padding-inline-start: 24px; position: relative; color: var(--muted, #6b7a93); }
.seo-checks li::before { content: "○"; position: absolute; inset-inline-start: 2px; }
.seo-checks li.ok { color: #166534; } .seo-checks li.ok::before { content: "✓"; font-weight: 900; }
.seo-checks li.bad { color: #9a3412; } .seo-checks li.bad::before { content: "!"; font-weight: 900; }
.seo-adv summary { cursor: pointer; font-weight: 700; margin: 6px 0; }
.tabs-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs-inline .chip { padding: .35em .9em; font-size: .85rem; background: #eef3fb; color: #1d4f9c; text-decoration: none; }
.tabs-inline .chip.is-on { background: var(--brand, #1565d8); color: #fff; }
@media (max-width: 1100px) { .blog-editor { grid-template-columns: 1fr; } .blog-side { position: static; max-height: none; } }

.blog-editor .field { margin-bottom: 14px; display: grid; gap: 6px; }
.blog-editor .grid-2 { gap: 12px; }

.section-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cur-switch { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: #fff; border: 1px solid var(--line, #d9e6f7); }
.cur-switch span { font-size: .8rem; color: var(--muted, #6b7a93); font-weight: 700; padding: 0 6px; }
.cur-switch button { font: inherit; font-size: .8rem; font-weight: 800; padding: .3em .8em; border-radius: 999px; border: 0; background: none; color: var(--brand, #1565d8); cursor: pointer; }
.cur-switch button.is-on { background: var(--brand, #1565d8); color: #fff; }
.plan-price .cur-billed { display: block; font-size: .75rem; font-weight: 600; }

.pill-warn { background: #f59e0b !important; color: #fff !important; }

/* ===== Live chat (support team) ===== */
.lc-card { display: flex; flex-direction: column; padding: 0 !important; overflow: hidden; }
.lc-thread { height: 56vh; min-height: 380px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: #f3f8ff; background-image: radial-gradient(rgba(21,101,216,.06) 1px, transparent 1px); background-size: 18px 18px; }
.lc-msg { max-width: 78%; border-radius: 16px; padding: 10px 14px; background: #fff; border: 1px solid #e3ebf6; }
.lc-msg .lc-head { display: flex; gap: 10px; justify-content: space-between; font-size: .78rem; margin-bottom: 3px; }
.lc-msg .lc-head time { color: var(--muted, #6b7a93); }
.lc-msg .lc-body { white-space: normal; overflow-wrap: anywhere; }
.lc-visitor { align-self: flex-start; border-top-left-radius: 4px; }
.lc-bot { align-self: flex-start; background: #f4f0ff; border-color: #e3d9ff; }
.lc-agent { align-self: flex-end; background: #d4e8ff; border-color: #bcd8fb; border-top-right-radius: 4px; }
.lc-system { align-self: center; background: #fff8e6; border: 1px dashed #f5d47a; font-size: .8rem; color: #7a5b00; padding: 4px 12px; border-radius: 999px; max-width: 92%; text-align: center; }
.lc-mailed { color: #1565d8; font-size: .72rem; font-weight: 700; }
.lc-reply { padding: 14px; border-top: 1px solid var(--line, #d9e6f7); background: #fff; display: grid; gap: 8px; }
.lc-reply textarea { width: 100%; }
.lc-reply-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.presence::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; margin-inline-end: 6px; }
.presence.on::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.team-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.team-list li { display: flex; gap: 12px; align-items: center; }
.team-list li > span:last-child { display: grid; }
.team-av { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #2f8bff, #0b3d91); flex-shrink: 0; }
.team-av i { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: #94a3b8; border: 2px solid #fff; }
.team-av i.on { background: #22c55e; }
.team-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.team-row form { margin: 0; }
tr.row-alert td { background: #fffbeb; }
.unread-dot { background: #ef4444; color: #fff; border-radius: 999px; padding: 0 7px; font-size: .72rem; }

/* ===== Wappx team & roles ===== */
.team-row-who { display: flex; gap: .7rem; align-items: center; }
.team-row-who > span:last-child { display: grid; gap: .05rem; }
.perm-chips .chip { background: #eef3fb; color: #1d4f9c; }
.role-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25em .7em; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eef1f0; color: #33433e; white-space: nowrap; }
.role-super_admin { background: #fff3d6; color: #8a5304; } .role-manager { background: #e4eefc; color: #1d4f9c; }
.role-support { background: #e3f4ec; color: #136c45; } .role-sales { background: #efe7fb; color: #5b2ea6; }
.role-billing { background: #fde6e6; color: #9b2c2c; } .role-content { background: #e6f6fb; color: #0e6684; }
.row-muted td { opacity: .55; }
form.inline { display: inline; margin-inline-start: .5rem; }
.link-btn.link-danger { color: #c0392b; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.role-card { position: relative; display: block; cursor: pointer; }
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card > span { display: grid; gap: .2rem; height: 100%; padding: .65rem .75rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.role-card b { font-size: .9rem; }
.role-card small { font-size: .74rem; color: var(--muted); line-height: 1.35; }
.role-card input:checked + span { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,101,216,.15); background: #f5f9ff; }
.role-card input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .55rem .9rem; }
.perm-grid .check span { display: grid; }
.perm-grid .check small { font-size: .74rem; }
[data-perm-box].is-locked { opacity: .55; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { font-weight: 600; font-size: .88rem; margin-bottom: .45rem; padding: 0; }
.role-matrix th, .role-matrix td { font-size: .8rem; }
.role-matrix td small { display: block; font-weight: 400; max-width: 220px; }
.role-matrix .yes { color: #16a34a; font-weight: 800; } .role-matrix .no { color: #c4ccd8; }

.team-actions { white-space: nowrap; }
.team-actions > * { display: flex; margin: 0 0 .35rem; }
.team-actions form.inline { margin: 0 0 .35rem; }
.role-matrix td.center { text-align: center; }

.team-actions { white-space: nowrap; }
.team-actions > *, .team-actions form.inline { display: inline-flex; margin: 0 0 0 .25rem; }
.tm-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2, #33433e); font-size: .9rem; cursor: pointer; text-decoration: none; }
.tm-btn:hover { border-color: var(--brand); color: var(--brand); }
.tm-btn.tm-danger:hover { border-color: #c0392b; color: #c0392b; }
.perm-chips { display: flex; flex-wrap: wrap; gap: .25rem; max-width: 260px; }
.perm-chips .chip { margin: 0; }

.tm-actions { display: inline-grid; gap: .3rem; justify-items: end; }
.team-actions .tm-actions > *, .team-actions .tm-actions form.inline { margin: 0; }
.perm-chips { max-width: 210px; }

/* ===== Onboarding wizard ===== */
.onb { border: 1.5px solid #bcd3fb; background: linear-gradient(135deg, #f5f9ff, #ffffff 60%); }
.onb-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.onb-head h2 { margin: .15rem 0 .25rem; }
.onb-kicker { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.onb-ring { --p: 0%; flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--brand) var(--p), #e3ebf8 0); }
.onb-ring span { width: 58px; height: 58px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; color: var(--brand); }
.onb-steps { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .55rem; }
.onb-step { display: flex; align-items: center; gap: .8rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.onb-step.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,101,216,.12); }
.onb-step.is-done { background: #f1faf5; border-color: #cfeadc; }
.onb-step.is-done .onb-txt strong { text-decoration: line-through; color: var(--muted); }
.onb-step.is-locked { opacity: .55; }
.onb-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: #e3ebf8; color: var(--brand); }
.onb-step.is-current .onb-num { background: var(--brand); color: #fff; }
.onb-step.is-done .onb-num { background: #16a34a; color: #fff; }
.onb-txt { flex: 1; display: grid; gap: .1rem; min-width: 0; }
.onb-txt small { color: var(--muted); font-size: .8rem; }
.onb-lock { font-size: .9rem; }
.onb-banner { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 0 0 1rem; padding: .75rem 1rem;
  border-radius: 14px; background: #fff7e6; border: 1px solid #f6d48b; color: #6b4404; }
.onb-modal { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(15,23,42,.35); }
.onb-modal::backdrop { background: rgba(10,25,60,.55); backdrop-filter: blur(3px); }
.onb-modal-in { position: relative; padding: 1.6rem 1.6rem 1.2rem; }
.onb-modal h2 { margin: .25rem 0 .35rem; }
.onb-x { position: absolute; top: .8rem; inset-inline-end: .8rem; border: 0; background: #eef3fb; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.onb-howto { margin: .75rem 0; padding-inline-start: 1.2rem; display: grid; gap: .3rem; font-size: .9rem; color: var(--ink-2); }
@media (max-width: 640px) { .onb-head { align-items: flex-start; } .onb-ring { width: 56px; height: 56px; } .onb-ring span { width: 44px; height: 44px; font-size: .8rem; }
  .onb-step { flex-wrap: wrap; } }

/* Talk to support (live chat) button in the top bar */
.topbar-chat { position: relative; display: inline-flex; align-items: center; gap: .35rem; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: #fff; font: inherit; font-weight: 700; font-size: .85rem; padding: .4rem .8rem; border-radius: 999px; cursor: pointer; margin-inline-end: .5rem; }
.topbar-chat:hover { background: rgba(255,255,255,.24); }
.topbar-chat i { position: absolute; top: -3px; inset-inline-end: -3px; width: 11px; height: 11px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.topbar-chat i[hidden] { display: none; }
@media (max-width: 640px) { .topbar-chat span { display: none; } }

/* ===== Announcements: editor, audience, files, reading view ===== */
.rte { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.rte:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,101,216,.12); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: .35rem; background: #f6f8fc; border-bottom: 1px solid var(--line); }
.rte-bar button, .rte-color { min-width: 32px; height: 30px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; font: inherit; font-size: .85rem; color: var(--ink-2); display: inline-grid; place-items: center; padding: 0 .4rem; position: relative; }
.rte-bar button:hover, .rte-color:hover { background: #e6edf9; }
.rte-color { font-weight: 800; color: #d92d20; }
.rte-hl { color: #e0b100; }
.rte-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.rte-sep { width: 1px; background: var(--line); margin: 4px 3px; }
.rte-area { min-height: 190px; max-height: 480px; overflow-y: auto; padding: .8rem 1rem; outline: none; line-height: 1.55; }
.rte-area:empty::before { content: attr(data-placeholder); color: #9aa6b8; }
.rte-area table, .rich-body table { border-collapse: collapse; margin: .5rem 0; }
.rte-area td, .rte-area th, .rich-body td, .rich-body th { border: 1px solid #d5ddeb; padding: .3rem .55rem; }
.rich-body { line-height: 1.65; font-size: 1rem; overflow-wrap: anywhere; }
.rich-body h1, .rich-body h2, .rich-body h3 { margin: 1rem 0 .4rem; }
.rich-body ul, .rich-body ol { padding-inline-start: 1.4rem; }
.rich-body a { color: var(--brand); text-decoration: underline; }
.drop { position: relative; display: grid; gap: .2rem; place-items: center; text-align: center; padding: 1rem; border: 1.5px dashed #b9c8e3; border-radius: 12px; background: #f8faff; cursor: pointer; }
.drop:hover { border-color: var(--brand); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-list { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .2rem; font-size: .85rem; }
.file-list .too-big { color: #c0392b; }
.aud-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.aud-card { position: relative; cursor: pointer; }
.aud-card input { position: absolute; opacity: 0; pointer-events: none; }
.aud-card > span { display: grid; gap: .15rem; padding: .6rem .7rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; height: 100%; }
.aud-card small { font-size: .74rem; color: var(--muted); }
.aud-card input:checked + span { border-color: var(--brand); background: #f5f9ff; box-shadow: 0 0 0 3px rgba(21,101,216,.12); }
.aud-pane[hidden] { display: none; }
.aud-pane input[type=search], .aud-pane textarea, .aud-pane select { width: 100%; }
.client-pick { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; margin-top: .4rem; display: grid; gap: .3rem; }
.client-pick label[hidden] { display: none; }
.announce-full h1 { margin: .2rem 0 1rem; }
.announce-kicker { margin: 0; color: var(--brand); font-weight: 700; font-size: .82rem; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.att-card { display: grid; gap: .3rem; padding: .75rem; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.att-card img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; }
.att-ico { font-size: 2rem; }
.att-name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Template header type + media preview */
.seg { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: .4rem .8rem; border: 1.5px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 600; background: #fff; }
.seg input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; }
[data-header-pane][hidden], [data-media-hint][hidden] { display: none; }
.wa-media { margin: -.5rem -.7rem .45rem; min-height: 90px; background: #dfe7f2; border-radius: 8px 8px 0 0; display: grid; place-items: center; font-size: 1.6rem; overflow: hidden; }
.wa-media[hidden] { display: none; }
.wa-media img { width: 100%; max-height: 220px; object-fit: cover; display: block; }

/* ===== Public payment link page ===== */
.pay-req h1 { margin: .2rem 0 .6rem; font-size: 1.35rem; }
.pay-from { margin: 0; color: var(--brand); font-weight: 700; font-size: .85rem; }
.pay-amount { font-size: 2.6rem; font-weight: 800; color: #0b3d91; letter-spacing: -.02em; margin: .2rem 0 .8rem; }
.pay-amount small { font-size: 1rem; margin-inline-end: .35rem; color: var(--muted); font-weight: 700; }
.pay-facts { display: grid; gap: .35rem; margin: 0 0 1rem; padding: .8rem 1rem; background: #f6f9fe; border-radius: 12px; }
.pay-facts div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.pay-facts dt { color: var(--muted); }
.pay-facts dd { margin: 0; font-weight: 600; text-align: end; }
.pay-overdue { color: #c0392b; }
.pay-note { background: #fffaf0; border: 1px solid #f3e1b5; border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; }
.pay-state { padding: .9rem 1rem; border-radius: 12px; background: #eef2f8; font-weight: 600; margin-bottom: .8rem; }
.pay-ok { background: #e8f8ef; color: #0f5a37; }
.btn-lg { padding: .85rem 1.2rem; font-size: 1.05rem; }

/* ===== Finance ===== */
.fin-tabs { margin: 0 0 1rem; }
.fin-tabs .chip-toggle { margin-inline-start: auto; background: #f1f3f7; color: #4a5a6e; }
.fin-tabs .chip-toggle.is-on { background: #fde9c8; color: #8a5304; }
.kpi .up { color: #16a34a; font-weight: 700; } .kpi .down { color: #c0392b; font-weight: 700; }
.kpi-alert .kpi-value { color: #b45309; }
.fin-clients { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.fin-pill { display: inline-flex; align-items: center; gap: .6rem; padding: .5rem .85rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .88rem; }
.fin-pill b { font-size: 1.05rem; }
.fin-pill.tone-ok b { color: #16a34a; } .fin-pill.tone-warn b { color: #c2410c; } .fin-pill.tone-info b { color: var(--brand); } .fin-pill.tone-muted b { color: #64748b; }
.fin-pill.tone-total { background: #f5f8fd; }
.fin-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: .4rem; align-items: end; height: 220px; padding-top: 1.2rem; }
.fin-bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: .2rem; min-width: 0; }
.fin-val { font-size: .62rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.fin-track { display: flex; align-items: flex-end; justify-content: center; background: #f3f6fb; border-radius: 8px; overflow: hidden; }
.fin-track span { display: block; width: 100%; background: linear-gradient(180deg, #3b8bff, #1565d8); border-radius: 8px 8px 0 0; min-height: 2px; }
.fin-bar small { font-size: .7rem; color: var(--muted); }
.fin-attn strong.warn, td .warn, small.warn { color: #c0392b; }
small.soon { color: #c2410c; font-weight: 600; }
.fin-actions { display: inline-flex; gap: .25rem; }
.fin-paid summary { cursor: pointer; font-size: .8rem; color: var(--brand); font-weight: 600; list-style: none; }
.fin-paid[open] form { margin-top: .4rem; }
.fin-paid select, .fin-paid input { min-height: 32px; }
.link-box { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.link-box code { flex: 1 1 260px; background: #fff; border: 1px solid #bfe6d1; border-radius: 8px; padding: .35rem .6rem; overflow-x: auto; white-space: nowrap; font-size: .82rem; }
.billing-req { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .9rem 1rem; border: 1.5px solid #f6d48b; background: #fffaf0; border-radius: 14px; margin-bottom: .6rem; }
.billing-req strong { font-size: 1.1rem; color: #0b3d91; }
@media (max-width: 640px) { .fin-chart { height: 160px; gap: .2rem; } .fin-val { display: none; } }
.pay-amount small { display: inline; }
.notif-list small { overflow-wrap: anywhere; }

/* ===== Connect WhatsApp: recommended (Facebook) + alternative (manual) ===== */
.es-card { position: relative; border: 2px solid #1877f2; border-radius: 16px; padding: 1.2rem 1.2rem 1rem; background: linear-gradient(135deg, #f3f8ff, #fff 70%); margin-bottom: 1rem; }
.es-badge { position: absolute; top: -12px; inset-inline-start: 16px; background: #1877f2; color: #fff; font-size: .75rem; font-weight: 800; padding: .25rem .7rem; border-radius: 999px; letter-spacing: .02em; }
.es-card h3 { margin: .3rem 0 .5rem; font-size: 1.1rem; }
.es-points { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: .25rem; font-size: .9rem; color: var(--ink-2); }
.es-points li { color: var(--ink-2); }
.btn-fb { display: inline-flex; align-items: center; gap: .6rem; background: #1877f2; color: #fff; border: 0; border-radius: 10px; padding: .75rem 1.2rem; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; box-shadow: 0 8px 20px rgba(24,119,242,.3); }
.btn-fb:hover { background: #166fe5; }
.btn-fb:disabled { opacity: .6; cursor: wait; box-shadow: none; }
.es-status { min-height: 1.2em; margin: .5rem 0 0; font-size: .85rem; color: var(--muted); }
.es-status.is-error { color: #c0392b; }
.es-alt { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.es-alt summary { cursor: pointer; list-style: none; padding: .8rem 1rem; display: grid; gap: .1rem; }
.es-alt summary::-webkit-details-marker { display: none; }
.es-alt summary span { font-weight: 700; }
.es-alt summary span::before { content: '▸ '; color: var(--brand); }
.es-alt[open] summary span::before { content: '▾ '; }
.es-alt summary small { color: var(--muted); font-size: .8rem; }
.es-alt-body { padding: 0 1rem 1rem; }
.ai-provider { display: inline-block; margin: 0 0 1rem; padding: .35rem .8rem; border-radius: 999px; background: #eef4ff; color: #1d4f9c; font-weight: 700; font-size: .85rem; }

/* Rows per page */
.list-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin: .5rem 0; }
.per-page { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0; }
.per-pick { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); }
.per-pick select { min-height: 32px; padding: .2rem .5rem; }
.per-custom { width: 90px; min-height: 32px; }
.per-custom[hidden], [data-per-go][hidden] { display: none; }
form.per-page { display: flex; flex-direction: row; align-items: center; gap: .5rem; flex-wrap: wrap; }
form.per-page .per-pick span { white-space: nowrap; }
form.per-page input.per-custom { width: 96px; flex: 0 0 96px; min-height: 32px; padding: .25rem .5rem; }
form.per-page .btn { flex: none; }

/* Template preview: real header file */
.wa-media.has-file { padding: 0; min-height: 0; background: #cfd8e3; }
.wa-media video { width: 100%; max-height: 240px; display: block; background: #0b1730; }
.wa-media .wa-file { font-size: .85rem; font-weight: 600; color: #3c5172; padding: 1.1rem .6rem; word-break: break-all; display: block; }
.aud-mode { margin-bottom: .8rem; }
[data-aud-pane][hidden] { display: none; }

/* Instant answers (saved Q&A) */
.faq-editor { display: grid; gap: .5rem; }
.faq-tools { align-items: center; gap: .6rem; }
.faq-filter { max-width: 320px; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: .55rem .8rem; }
.faq-item[hidden] { display: none; }
.faq-item > summary { cursor: pointer; display: flex; justify-content: space-between; gap: .8rem; align-items: center; list-style: none; font-weight: 600; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item[open] > summary { margin-bottom: .6rem; }
.faq-item.is-off { opacity: .6; }
.faq-new { border-style: dashed; border-color: var(--brand); background: #f5f9ff; }
.faq-new > summary { color: var(--brand); }
.faq-meta { display: inline-flex; gap: .3rem; align-items: center; flex-shrink: 0; font-weight: 500; font-size: .8rem; }
.faq-answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.faq-answers textarea[lang="ur"] { font-family: var(--font-ur); line-height: 2; }
@media (max-width: 900px) { .faq-answers { grid-template-columns: 1fr; } }

/* New message popup */
.pulse-stack { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 900; display: grid; gap: .6rem; width: min(360px, calc(100vw - 32px)); }
.pulse-card { background: #fff; color: #0f2140; border: 1px solid var(--line); border-inline-start: 4px solid #25d366; border-radius: 14px; box-shadow: 0 18px 50px rgba(11, 32, 80, .22); padding: .8rem .9rem; animation: pulse-in .28s ease-out; }
.pulse-card.out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes pulse-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.pulse-head { display: flex; align-items: center; gap: .6rem; }
.pulse-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #e9fbf0; flex-shrink: 0; }
.pulse-tt { display: grid; flex: 1; min-width: 0; }
.pulse-tt strong { color: #0f2140; font-size: .95rem; }
.pulse-tt small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: .9rem; padding: .2rem; }
.pulse-body { margin: .5rem 0 .3rem; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pulse-more { margin: 0 0 .3rem; font-size: .8rem; color: var(--muted); }
.pulse-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.pulse-row .link-btn { font-size: .8rem; }
body.cw-open .pulse-stack { bottom: 96px; }

/* ===== Automation flows ===== */
.starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; }
.starter-card { position: relative; cursor: pointer; }
.starter-card input { position: absolute; opacity: 0; }
.starter-card > span { display: grid; gap: .25rem; padding: .9rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; height: 100%; transition: .15s; }
.starter-card input:checked + span { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 101, 216, .15); background: #f5f9ff; }
.starter-card input:focus-visible + span { outline: 2px solid var(--brand); }
.starter-ico { font-size: 1.4rem; }
.icon-mini { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 26px; height: 24px; cursor: pointer; font-size: .7rem; color: var(--muted); }
.icon-mini:disabled { opacity: .35; cursor: default; }
.switch { display: inline-flex; align-items: center; gap: .45rem; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); padding: 0; }
.switch i { width: 38px; height: 22px; border-radius: 99px; background: #cbd6e6; position: relative; transition: .2s; flex-shrink: 0; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch.on { color: #12823e; }
.switch.on i { background: #25d366; }
.switch.on i::after { inset-inline-start: 19px; }

.content:has(> .flow-app) { max-width: none; padding: .75rem .9rem; }
.main:has(> .content > .flow-app) { height: 100vh; height: 100dvh; overflow: hidden; }
.main:has(> .content > .flow-app) > .content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.flow-app { flex: 1; min-height: 480px; display: flex; flex-direction: column; gap: .6rem; }
.flow-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .55rem .7rem; }
.flow-name { font-weight: 700; font-size: 1.05rem; border: 1px solid transparent; background: transparent; padding: .35rem .5rem; border-radius: 8px; min-width: 200px; max-width: 360px; }
.flow-name:hover, .flow-name:focus { border-color: var(--line); background: #f7faff; }
.flow-state { font-size: .8rem; color: var(--muted); }
.flow-state.is-dirty { color: #b26b00; }
.flow-state.is-ok { color: #12823e; }
.flow-state.is-bad { color: #c62828; }
.flow-problems { margin: 0; }
.flow-problems ul { margin: .3rem 0 0; padding-inline-start: 1.2rem; }
.flow-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr) 310px; gap: .6rem; }
.flow-palette, .flow-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .7rem; overflow-y: auto; }
.flow-palette .nav-label { color: var(--muted); margin: .2rem 0 .5rem; }
.pal-item { display: flex; gap: .6rem; align-items: center; width: 100%; text-align: start; padding: .6rem .65rem; margin-bottom: .45rem; border: 1px solid var(--line); border-radius: 12px; background: #f9fbff; cursor: grab; font: inherit; color: inherit; }
.pal-item:hover { border-color: var(--brand); background: #fff; box-shadow: 0 4px 14px rgba(21, 101, 216, .12); }
.pal-item:active { cursor: grabbing; }
.pal-item b { font-size: 1.25rem; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); flex-shrink: 0; }
.pal-item span { display: grid; }
.pal-item small { color: var(--muted); font-size: .72rem; line-height: 1.3; }
.flow-canvas-wrap { position: relative; overflow: auto; border-radius: 14px; border: 1px solid var(--line); background-color: #f4f8fe;
  background-image: radial-gradient(circle, #c9d8ee 1px, transparent 1px); background-size: 22px 22px; cursor: grab; }
.flow-canvas-wrap.drag-over { outline: 2px dashed var(--brand); outline-offset: -6px; }
.flow-sizer { position: relative; }
.flow-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.flow-edges { position: absolute; left: 0; top: 0; overflow: visible; }
.fedge-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; }
.fedge-line { fill: none; stroke: #6f9be0; stroke-width: 2.5; pointer-events: none; }
.fedge:hover .fedge-line { stroke: var(--brand); stroke-width: 3; }
.fedge-temp { stroke-dasharray: 6 5; stroke: var(--brand); }
.fedge-del { cursor: pointer; opacity: 0; transition: .15s; }
.fedge:hover .fedge-del { opacity: 1; }
.fedge-del circle { fill: #fff; stroke: #e05252; stroke-width: 1.5; }
.fedge-del text { fill: #e05252; font-size: 10px; font-weight: 700; }
.flow-zoom { position: sticky; top: 10px; left: 10px; z-index: 5; display: inline-flex; align-items: center; gap: .2rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .2rem; box-shadow: 0 4px 14px rgba(11, 32, 80, .08); margin: 10px; }
.flow-zoom button { border: 0; background: none; width: 28px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 1rem; color: var(--ink); }
.flow-zoom button:hover { background: #eef4fd; }
.flow-zoom span { font-size: .75rem; min-width: 38px; text-align: center; color: var(--muted); }
.fnode { position: absolute; width: 250px; background: #fff; border: 1.5px solid #d3e1f4; border-radius: 14px; box-shadow: 0 6px 20px rgba(11, 32, 80, .08); cursor: move; user-select: none; touch-action: none; }
.fnode.sel { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 101, 216, .18), 0 10px 26px rgba(11, 32, 80, .12); }
.fnode.drop-ok { border-color: #25d366; box-shadow: 0 0 0 3px rgba(37, 211, 102, .25); }
.fnode-head { display: flex; align-items: center; gap: .45rem; padding: .5rem .65rem; border-bottom: 1px solid #edf2fa; font-weight: 700; font-size: .85rem; border-radius: 13px 13px 0 0; }
.fnode-head span { flex: 1; }
.fnode-start .fnode-head { background: linear-gradient(90deg, #1565d8, #2f8bff); color: #fff; border-bottom: 0; }
.fnode-message .fnode-head { background: #eef5ff; }
.fnode-buttons .fnode-head { background: #f3efff; }
.fnode-tag .fnode-head { background: #fff6e6; }
.fnode-assign .fnode-head { background: #e9fbf0; }
.fnode-shop .fnode-head { background: #fdeef6; }
.fnode-x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: .8rem; padding: .1rem .3rem; border-radius: 6px; }
.fnode-x:hover { background: #fde8e8; color: #c62828; }
.fnode-body { padding: .55rem .65rem .65rem; font-size: .8rem; display: grid; gap: .35rem; }
.fn-text { white-space: pre-wrap; word-break: break-word; color: var(--ink); line-height: 1.4; }
.fn-warn { color: #b26b00; font-style: italic; }
.fn-muted { color: var(--muted); font-size: .72rem; }
.fn-line { display: flex; flex-wrap: wrap; gap: .25rem; }
.fn-chip { display: inline-block; padding: .1rem .5rem; border-radius: 99px; background: #eef4fd; color: #1b4f9c; font-size: .74rem; font-weight: 600; }
.fnode-start .fn-chip { background: #e6efff; }
.fn-file { padding: .3rem .45rem; border-radius: 8px; background: #f4f7fb; font-size: .74rem; word-break: break-all; }
.fn-btn { position: relative; padding: .35rem .55rem; border: 1px solid #ddd3fb; border-radius: 9px; background: #faf8ff; font-weight: 600; color: #4b2fb0; }
.port { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2.5px solid #6f9be0; }
.port-in { left: -8px; top: 18px; }
.port-out { right: -9px; top: 50%; margin-top: -7px; cursor: crosshair; }
.port-next { top: auto; bottom: 14px; margin-top: 0; }
.fn-btn .port-out { right: -18px; }
.port-out:hover, .port-out.linked { background: #6f9be0; }
.port-out:hover { transform: scale(1.25); }
.flow-panel .panel-title { margin: 0 0 .2rem; font-size: 1rem; }
.flow-panel .field { margin-top: .7rem; }
.flow-panel textarea, .flow-panel select, .flow-panel input[type=text] { width: 100%; }
.btn-list { display: grid; gap: .4rem; margin: .6rem 0; }
.btn-list .tool-row { flex-wrap: nowrap; }
.attach-chip { display: grid; gap: .4rem; padding: .5rem; border: 1px solid var(--line); border-radius: 10px; background: #f9fbff; font-size: .8rem; word-break: break-all; }
.attach-chip img { max-width: 100%; max-height: 160px; border-radius: 8px; object-fit: cover; }
.error-text { color: #c62828; }
@media (max-width: 1100px) { .flow-body { grid-template-columns: 180px minmax(0, 1fr) 260px; } }
@media (max-width: 860px) {
  .main:has(> .content > .flow-app) { height: auto; overflow: visible; }
  .flow-body { grid-template-columns: 1fr; }
  .flow-canvas-wrap { height: 60vh; }
  .flow-palette { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
  .flow-palette .nav-label, .flow-palette .hint { grid-column: 1 / -1; }
}
.flow-problems[hidden] { display: none !important; }
.flow-problems:not([hidden]) { display: block; }

/* ===== Bookings (add-on) ===== */
.badge-info { background: #e8f0ff; color: #1b4f9c; }
.pill-addon { background: #fff3d6; color: #8a5a00; font-size: .62rem; }
.bk-tabs { margin: -.3rem 0 1rem; }
.bk-upsell { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.5rem; align-items: start; }
.bk-upsell h2 { margin: .5rem 0 .3rem; font-size: 1.5rem; }
.bk-features { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.bk-features li::before { content: "✔"; color: #12823e; font-weight: 800; margin-inline-end: .5rem; }
.bk-price { border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; background: linear-gradient(160deg, #f5f9ff, #fff); display: grid; gap: .7rem; text-align: center; }
.bk-amount { font-size: 2rem; font-weight: 800; color: #0b2f6e; }
.bk-amount small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.bk-how { display: grid; gap: .5rem; padding-inline-start: 1.2rem; }
.bk-agenda { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.bk-day { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .6rem; }
.bk-row { display: flex; align-items: center; gap: .8rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: #fff; }
.bk-row:hover, .bk-row.is-current { border-color: var(--brand); background: #f7faff; }
.bk-time { font-weight: 800; color: #0b2f6e; min-width: 72px; font-size: .9rem; }
.bk-main { flex: 1; display: grid; min-width: 0; }
.bk-main small { color: var(--muted); }
.bk-bars { display: flex; align-items: flex-end; gap: .3rem; height: 170px; padding-top: 1.2rem; }
.bk-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-decoration: none; color: var(--muted); position: relative; }
.bk-bar i { display: block; width: 100%; max-width: 26px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #2f8bff, #1565d8); min-height: 3px; }
.bk-bar:hover i { background: #0b3d91; }
.bk-bar small { font-size: .62rem; text-align: center; line-height: 1.15; margin-top: .25rem; }
.bk-bar-n { font-size: .7rem; font-weight: 700; color: #0b2f6e; }
.bk-top { position: relative; display: flex; justify-content: space-between; padding: .45rem .6rem; margin-bottom: .35rem; border-radius: 8px; overflow: hidden; z-index: 0; }
.bk-top i { position: absolute; inset-block: 0; inset-inline-start: 0; background: #eaf2ff; z-index: -1; }
.bk-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.bk-filters input[type=search] { flex: 1 1 200px; }
.bk-filters select, .bk-filters input[type=date] { width: auto; flex: 0 1 170px; }
.bk-filters input[type=search] { min-width: 0; }
.inline-label { display: inline-flex; gap: .3rem; align-items: center; font-size: .82rem; color: var(--muted); }
.bk-dl { display: grid; grid-template-columns: 140px 1fr; gap: .5rem 1rem; margin: 1rem 0 0; }
.bk-dl dt { color: var(--muted); font-size: .85rem; }
.bk-dl dd { margin: 0; }
.bk-slots { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: -.2rem 0 .6rem; }
.bk-slots small { width: 100%; }
.bk-slot { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .25rem .55rem; font: inherit; font-size: .8rem; cursor: pointer; }
.bk-slot:hover, .bk-slot.on { border-color: var(--brand); background: #eaf2ff; color: #0b3d91; font-weight: 700; }
.bk-hours { display: grid; grid-template-columns: 110px auto auto; gap: .45rem .8rem; align-items: center; }
.bk-range { display: inline-flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.bk-range input[type=time] { width: auto; }
.bk-svcs { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .4rem; }
.bk-svcs li { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 12px; }
.bk-svcs li > span { flex: 1; display: grid; }
.bk-svcs li.is-off { opacity: .6; }
.bk-edit { border: 1px solid var(--brand); border-radius: 12px; padding: .8rem; margin-bottom: 1rem; background: #f7faff; }
.switch-row { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: #f9fbff; cursor: pointer; }
.switch-row span { display: grid; }
.side-bookings { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .6rem; display: grid; gap: .35rem; }
.side-bk { display: grid; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .82rem; }
.side-bk small { color: var(--muted); }
.addon-row { display: flex; align-items: center; gap: .9rem; padding: .8rem; border: 1px solid var(--line); border-radius: 14px; flex-wrap: wrap; }
.addon-ico { font-size: 1.5rem; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #eef5ff; }
.addon-main { flex: 1 1 260px; display: grid; gap: .15rem; }
.addon-on { color: #12823e; font-weight: 600; }
.addon-price { font-weight: 800; color: #0b2f6e; }
.addon-price small { color: var(--muted); font-weight: 600; }
.addon-admin { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; margin-top: .6rem; }
@media (max-width: 860px) { .bk-upsell { grid-template-columns: 1fr; } .bk-hours { grid-template-columns: 1fr; } .bk-dl { grid-template-columns: 1fr; } }
.kpis-6 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* Plan features: included / not included */
.feature-list li.feat-on { font-weight: 700; }
.feature-list li.feat-off { color: var(--muted, #7b8aa5); text-decoration: line-through; text-decoration-color: rgba(123,138,165,.5); }
.feature-list li.feat-off::before { content: "✕"; color: #b8c2d6; }

/* ---------- WhatsApp Store ---------- */
.sh-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: .25rem; margin-bottom: 1rem; }
.sh-tabs a { white-space: nowrap; }
.sh-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .8rem; }
.sh-chips .chip { font-size: .8rem; padding: .3rem .7rem; background: #fff; color: var(--ink-2); border: 1px solid var(--line); text-decoration: none; }
.sh-chips .chip.on { background: var(--brand-50); color: var(--brand); border-color: transparent; }
.sh-thumb-cell { width: 56px; }
.sh-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: #eef3fb; border: 1px solid var(--line); font-size: 1.2rem; }
.sh-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.sh-img { display: grid; gap: .3rem; font-size: .8rem; }
.sh-img img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.sh-steps { list-style: none; display: flex; gap: .3rem; padding: 0; margin: .4rem 0 1rem; counter-reset: st; flex-wrap: wrap; }
.sh-steps li { flex: 1 1 90px; font-size: .78rem; font-weight: 700; color: var(--muted, #7b8aa5); padding-top: .55rem; border-top: 4px solid #e3e9f3; }
.sh-steps li.done { color: var(--brand); border-top-color: var(--brand); }
.sh-timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.sh-timeline li { display: grid; gap: .1rem; padding-inline-start: 1rem; border-inline-start: 2px solid #dbe6f5; }
.sh-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.sh-mini li { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.sh-inline { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.sh-inline input, .sh-inline select { width: auto; flex: 0 1 180px; min-width: 0; }
.sh-num, .sh-inline .sh-num { width: 6.5rem; flex: 0 0 6.5rem; }
.sh-cat-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .45rem 0; border-bottom: 1px solid var(--line); }
td.neg { color: #b42318; font-weight: 700; } td.pos { color: #137a43; font-weight: 700; }
.sh-switch span { display: grid; gap: .1rem; }
.sh-pay-done { text-align: center; display: grid; gap: .6rem; padding: 1rem 0; }
.sh-pay-done .big-ico { font-size: 3rem; }
