/* WaFlow Pro – design tokens & base components */
:root {
  --brand: #00a884; --brand-600: #008f72; --brand-50: #e7f8f3; --brand-100: #c9efe4;
  --bg: #f4f6f8; --surface: #ffffff; --surface-2: #f8fafb; --border: #e4e8ec; --border-strong: #cfd6dc;
  --text: #101828; --text-2: #475467; --text-3: #8a94a3;
  --danger: #e5484d; --danger-50: #fdecec; --warn: #f59e0b; --warn-50: #fff6e5; --info: #3b82f6; --info-50: #eaf2ff;
  --radius: 14px; --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06); --shadow: 0 6px 24px rgba(16,24,40,.08); --shadow-lg: 0 24px 64px rgba(16,24,40,.18);
  --wa-wall: #efeae2; --wa-out: #d9fdd3; --wa-text: #111b21;
  color-scheme: light;
}
:root[data-accent="blue"] { --brand: #2f6fed; --brand-600: #2257c7; --brand-50: #ebf1fe; --brand-100: #d3e1fd; }
:root[data-accent="violet"] { --brand: #7c5cff; --brand-600: #6544e8; --brand-50: #f1eeff; --brand-100: #e1daff; }
:root[data-accent="rose"] { --brand: #e8467c; --brand-600: #cb2f63; --brand-50: #fdebf1; --brand-100: #fad3e1; }
:root[data-accent="orange"] { --brand: #f2711c; --brand-600: #d55d0c; --brand-50: #fef0e6; --brand-100: #fde0cc; }
:root.dark {
  --bg: #0d1117; --surface: #151b23; --surface-2: #1b222c; --border: #262f3a; --border-strong: #34404d;
  --text: #e8edf2; --text-2: #a7b1bd; --text-3: #6f7a87; --brand-50: rgba(0,168,132,.12); --brand-100: rgba(0,168,132,.22);
  --danger-50: rgba(229,72,77,.14); --warn-50: rgba(245,158,11,.14); --info-50: rgba(59,130,246,.14);
  --shadow: 0 6px 24px rgba(0,0,0,.35); --shadow-lg: 0 24px 64px rgba(0,0,0,.55);
  --wa-wall: #0b141a; --wa-out: #005c4b; --wa-text: #e9edef;
  color-scheme: dark;
}
:root.dark[data-accent="blue"] { --brand-50: rgba(47,111,237,.14); --brand-100: rgba(47,111,237,.25); }
:root.dark[data-accent="violet"] { --brand-50: rgba(124,92,255,.14); --brand-100: rgba(124,92,255,.25); }
:root.dark[data-accent="rose"] { --brand-50: rgba(232,70,124,.14); --brand-100: rgba(232,70,124,.25); }
:root.dark[data-accent="orange"] { --brand-50: rgba(242,113,28,.14); --brand-100: rgba(242,113,28,.25); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
::selection { background: var(--brand-100); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 700; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { flex: 1; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; letter-spacing: .5px; text-transform: uppercase; color: var(--text-2); margin: 0 0 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-soft { background: var(--brand-50); border-color: transparent; color: var(--brand); }
.btn-soft:hover { background: var(--brand-100); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--danger); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
.icon-btn.sm { width: 30px; height: 30px; }

.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; padding: 12px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.input-icon { position: relative; }
.input-icon .input { padding-left: 38px; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--text-2); margin-bottom: 6px; }
.field + .field { margin-top: 14px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.green { background: var(--brand-50); color: var(--brand); border-color: transparent; }
.badge.red { background: var(--danger-50); color: var(--danger); border-color: transparent; }
.badge.amber { background: var(--warn-50); color: #c27803; border-color: transparent; }
.badge.blue { background: var(--info-50); color: var(--info); border-color: transparent; }
.badge.pro { background: linear-gradient(135deg, #f7b733, #fc4a1a); color: #fff; border: 0; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.seg button { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }

.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .ico { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }

/* WhatsApp preview */
.wa-wall { background-color: var(--wa-wall); background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 16px 16px; }
.dark .wa-wall { background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px); }
.wa-bubble { position: relative; margin-left: auto; max-width: 88%; width: fit-content; min-width: 90px; background: var(--wa-out); color: var(--wa-text); border-radius: 10px 2px 10px 10px; padding: 6px 9px 20px; font-size: 14.2px; line-height: 1.42; word-wrap: break-word; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-bubble::after { content: ""; position: absolute; right: -7px; top: 0; width: 0; height: 0; border-left: 8px solid var(--wa-out); border-bottom: 10px solid transparent; }
.wa-bubble .meta { position: absolute; right: 8px; bottom: 3px; font-size: 11px; opacity: .65; display: flex; gap: 3px; align-items: center; }
.wa-bubble .meta svg { color: #53bdeb; }
.wa-line { min-height: 1em; }
.wa-mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; white-space: pre-wrap; display: block; }
.wa-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: rgba(0,0,0,.08); border-radius: 4px; padding: 0 4px; }
.wa-quote { border-left: 3px solid #06cf9c; padding-left: 8px; opacity: .85; margin: 2px 0; }
.wa-list { margin: 2px 0; padding-left: 22px; }
.wa-link { color: #027eb5; text-decoration: underline; word-break: break-all; }
.dark .wa-link { color: #53bdeb; }

/* animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.page { animation: fadeUp .25s ease backwards; }
.spin { animation: spin 1s linear infinite; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }

.section-title.mt { margin-top: 22px; }

/* shared helpers for WaFlow Hub */
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.meter > div { height: 100%; border-radius: 99px; background: var(--brand); transition: width .3s; }
.me-menu button b { font-weight: 700; }
