/* AUTO DADY AI — "Aurora Violet" theme (SPEC §3 tokens only) */
:root{
  --ink:#211D2E; --bg:#F4F3F8; --card:#FFFFFF;
  --primary:#5B3EDB; --primary-deep:#4527B8; --primary-soft:#EDE9FD;
  --accent:#F59E0B; --accent-soft:#FEF3C7;
  --success:#16A34A; --danger:#DC2626; --info:#0284C7;
  --sidebar-bg:#241B3A; --sidebar-text:#C9C2E6;
  --muted:#6E6884; --border:#E7E4F0; --radius:14px;
  --shadow:0 1px 3px rgba(33,29,46,.08);
  --font:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:var(--font);background:var(--bg);color:var(--ink);font-size:14px;line-height:1.5}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
button{font-family:var(--font);cursor:pointer}
input,select,textarea{font-family:var(--font);font-size:14px;color:var(--ink)}

/* ---------- Sample-data banner ---------- */
.sample-banner{
  position:sticky;top:0;z-index:60;background:var(--accent-soft);color:#92400E;
  border-bottom:1px solid #FDE68A;text-align:center;font-size:12px;font-weight:700;
  letter-spacing:.06em;padding:6px 12px;
}

/* ---------- Layout ---------- */
.app{display:flex;min-height:100vh}
.sidebar{
  width:260px;flex:0 0 260px;background:var(--sidebar-bg);color:var(--sidebar-text);
  display:flex;flex-direction:column;position:fixed;top:0;bottom:0;left:0;z-index:50;
  transition:transform .25s ease;
}
.main{flex:1;margin-left:260px;min-width:0;display:flex;flex-direction:column}
.content{max-width:1200px;width:100%;margin:0 auto;padding:24px 28px 48px}

/* ---------- Sidebar ---------- */
.logo{display:flex;align-items:center;gap:10px;padding:20px 18px 14px;color:#fff}
.logo-mark{
  width:38px;height:38px;border-radius:11px;flex:0 0 38px;
  background:linear-gradient(135deg,var(--primary),#8B5CF6 60%,var(--accent));
  display:flex;align-items:center;justify-content:center;font-weight:800;font-size:18px;color:#fff;
}
.logo-name{font-size:16px;font-weight:800;letter-spacing:.02em;line-height:1.1}
.logo-sub{font-size:11px;color:var(--sidebar-text);letter-spacing:.14em;text-transform:uppercase}
.nav{flex:1;overflow-y:auto;padding:6px 12px 12px}
.nav-group{margin-top:14px}
.nav-group-label{
  font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:#8B82B0;padding:0 10px 6px;
}
.nav-item{
  display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:9px;
  color:var(--sidebar-text);font-size:14px;margin-bottom:2px;
}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff;text-decoration:none}
.nav-item.active{background:var(--primary);color:#fff;font-weight:600}
.nav-icon{width:20px;text-align:center;font-size:15px;flex:0 0 20px}
.nav-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.badge{
  background:var(--accent);color:#211D2E;font-size:11px;font-weight:800;
  min-width:20px;height:20px;border-radius:10px;display:inline-flex;
  align-items:center;justify-content:center;padding:0 6px;
}
.nav-item.active .badge{background:#fff;color:var(--primary-deep)}
.user-card{
  margin:12px;padding:12px;background:rgba(255,255,255,.07);border-radius:var(--radius);
  display:flex;align-items:center;gap:10px;
}
.avatar{
  width:36px;height:36px;border-radius:50%;background:var(--primary);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:700;flex:0 0 36px;
}
.user-card .u-name{color:#fff;font-weight:600;font-size:13px}
.user-card .u-role{font-size:12px;color:var(--sidebar-text)}
.user-card .u-plan{margin-left:auto;font-size:11px;font-weight:700;color:var(--accent);white-space:nowrap}

/* ---------- Topbar ---------- */
.topbar{
  background:var(--card);border-bottom:1px solid var(--border);
  display:flex;align-items:center;gap:14px;padding:12px 28px;position:sticky;top:0;z-index:40;
}
.hamburger{display:none;background:none;border:1px solid var(--border);border-radius:9px;
  width:38px;height:38px;font-size:18px;color:var(--ink)}
.page-title{font-size:19px;font-weight:800;white-space:nowrap}
.search{flex:1;max-width:420px;display:flex}
.search input{
  width:100%;border:1px solid var(--border);border-radius:10px;padding:9px 12px;
  background:var(--bg);outline:none;
}
.search input:focus{border-color:var(--primary);background:#fff}
.workspace-switcher{
  display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:10px;
  background:#fff;padding:8px 12px;font-weight:600;font-size:13px;white-space:nowrap;
}
.status-pills{display:flex;gap:8px}
.pill{
  font-size:12px;font-weight:700;padding:6px 10px;border-radius:999px;white-space:nowrap;
  display:inline-flex;align-items:center;gap:6px;
}
.pill .dot{width:8px;height:8px;border-radius:50%;background:currentColor}
.pill-ok{background:#DCFCE7;color:#15803D}
.pill-warn{background:var(--accent-soft);color:#92400E}
.pill-info{background:#E0F2FE;color:#0369A1}
.top-avatar{width:36px;height:36px;border-radius:50%;background:var(--primary-deep);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:700;flex:0 0 36px}

/* ---------- Generic components ---------- */
h2.section-title{font-size:16px;font-weight:800;margin:26px 0 12px}
h2.section-title:first-child{margin-top:0}
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:18px}
.card h3{font-size:15px;font-weight:700;margin-bottom:4px}
.card .sub{color:var(--muted);font-size:13px}
.grid{display:grid;gap:16px}
.grid-2{grid-template-columns:1fr 1fr}
.grid-3{grid-template-columns:repeat(3,1fr)}
.btn{
  display:inline-flex;align-items:center;gap:7px;border-radius:10px;padding:9px 15px;
  font-size:14px;font-weight:600;border:1px solid transparent;
}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-deep);text-decoration:none}
.btn-ghost{background:#fff;border-color:var(--border);color:var(--ink)}
.btn-ghost:hover{border-color:var(--primary);color:var(--primary)}
.btn-danger-ghost{background:#fff;border-color:#FECACA;color:var(--danger)}
.btn-sm{padding:6px 11px;font-size:13px}
.tag{display:inline-block;font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;background:var(--primary-soft);color:var(--primary-deep)}
.tag-green{background:#DCFCE7;color:#15803D}
.tag-amber{background:var(--accent-soft);color:#92400E}
.tag-red{background:#FEE2E2;color:#B91C1C}
.tag-grey{background:#EDE9F5;color:var(--muted)}
.muted{color:var(--muted)}
.sample-note{font-size:12px;color:var(--muted);font-style:italic}

/* ---------- Overview ---------- */
.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.stat{display:flex;gap:14px;align-items:flex-start}
.stat-icon{
  width:44px;height:44px;border-radius:12px;background:var(--primary-soft);color:var(--primary);
  display:flex;align-items:center;justify-content:center;font-size:20px;flex:0 0 44px;
}
.stat-value{font-size:24px;font-weight:800;line-height:1.15}
.stat-label{font-size:13px;color:var(--muted)}
.stat-delta{font-size:12px;font-weight:700;color:var(--success)}
.activity{list-style:none}
.activity li{display:flex;gap:12px;padding:11px 0;border-bottom:1px solid var(--border)}
.activity li:last-child{border-bottom:none}
.activity .a-dot{width:9px;height:9px;border-radius:50%;background:var(--primary);margin-top:6px;flex:0 0 9px}
.activity .a-time{margin-left:auto;color:var(--muted);font-size:12px;white-space:nowrap}
.quick-actions{display:flex;flex-wrap:wrap;gap:10px}
.status-row{display:flex;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid var(--border)}
.status-row:last-child{border-bottom:none}
.status-row .s-name{font-weight:600}
.status-row .s-detail{color:var(--muted);font-size:13px}
.status-row .pill{margin-left:auto}

/* ---------- Tables ---------- */
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px}
thead th{
  position:sticky;top:0;background:var(--card);text-align:left;font-size:12px;
  text-transform:uppercase;letter-spacing:.06em;color:var(--muted);
  padding:10px 12px;border-bottom:1px solid var(--border);
}
tbody td{padding:12px;border-bottom:1px solid var(--border);vertical-align:middle}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:#FAF9FD}
tbody tr.selected{background:var(--primary-soft)}
tbody tr{cursor:pointer}

/* ---------- Inbox ---------- */
.inbox{display:grid;grid-template-columns:300px 1fr 280px;gap:0;border:1px solid var(--border);
  border-radius:var(--radius);background:var(--card);box-shadow:var(--shadow);
  height:calc(100vh - 220px);min-height:520px;overflow:hidden}
.inbox-list{border-right:1px solid var(--border);display:flex;flex-direction:column;min-width:0}
.inbox-list .list-head{padding:14px;border-bottom:1px solid var(--border)}
.inbox-list .list-head input{width:100%;border:1px solid var(--border);border-radius:9px;padding:8px 10px;background:var(--bg)}
.filter-tabs{display:flex;gap:6px;padding:10px 14px;border-bottom:1px solid var(--border);flex-wrap:wrap}
.filter-tab{
  border:1px solid var(--border);background:#fff;border-radius:999px;padding:5px 12px;
  font-size:13px;font-weight:600;color:var(--muted);
}
.filter-tab.active{background:var(--primary);border-color:var(--primary);color:#fff}
.convs{overflow-y:auto;flex:1}
.conv{display:flex;gap:11px;padding:13px 14px;border-bottom:1px solid var(--border);cursor:pointer}
.conv:hover{background:#FAF9FD}
.conv.active{background:var(--primary-soft)}
.conv-avatar{width:40px;height:40px;border-radius:50%;flex:0 0 40px;display:flex;
  align-items:center;justify-content:center;font-weight:700;color:#fff}
.conv-body{min-width:0;flex:1}
.conv-top{display:flex;justify-content:space-between;gap:8px}
.conv-name{font-weight:700;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conv-time{font-size:11px;color:var(--muted);white-space:nowrap}
.conv-preview{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conv-meta{display:flex;gap:6px;margin-top:5px;align-items:center}
.chan{font-size:11px;font-weight:700;padding:2px 7px;border-radius:6px}
.chan-wa{background:#DCFCE7;color:#15803D}
.chan-ig{background:#FCE7F3;color:#BE185D}
.chan-fb{background:#DBEAFE;color:#1D4ED8}
.unread-dot{margin-left:auto;background:var(--primary);color:#fff;font-size:11px;font-weight:800;
  min-width:19px;height:19px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px}
.thread{display:flex;flex-direction:column;min-width:0}
.thread-head{padding:13px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:12px}
.thread-head .t-name{font-weight:800}
.thread-head .t-sub{font-size:12px;color:var(--muted)}
.pause-banner{
  background:var(--accent-soft);color:#92400E;font-size:13px;font-weight:600;
  padding:9px 18px;border-bottom:1px solid #FDE68A;
}
.messages{flex:1;overflow-y:auto;padding:20px 22px;display:flex;flex-direction:column;gap:12px;background:#FBFAFE}
.msg{max-width:68%;padding:11px 14px;border-radius:14px;font-size:14px;line-height:1.5}
.msg .m-time{display:block;font-size:11px;color:var(--muted);margin-top:4px}
.msg-in{background:#fff;border:1px solid var(--border);border-bottom-left-radius:4px;align-self:flex-start}
.msg-out{background:var(--primary);color:#fff;border-bottom-right-radius:4px;align-self:flex-end}
.msg-out .m-time{color:#D9D2FF}
.msg-ai{background:var(--primary-soft);border:1px solid #D9D2FF;border-bottom-right-radius:4px;align-self:flex-end}
.msg-ai .m-tag{font-size:11px;font-weight:800;color:var(--primary-deep);letter-spacing:.06em}
.composer{border-top:1px solid var(--border);padding:14px 18px}
.composer textarea{
  width:100%;border:1px solid var(--border);border-radius:10px;padding:10px 12px;
  resize:vertical;min-height:52px;background:#fff;
}
.composer-row{display:flex;gap:8px;margin-top:10px;align-items:center}
.composer-row .ai-toggle{margin-left:auto;font-size:13px;color:var(--muted);display:flex;align-items:center;gap:6px}
.contact-panel{border-left:1px solid var(--border);overflow-y:auto;padding:18px}
.contact-panel h4{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:18px 0 8px}
.contact-panel h4:first-child{margin-top:0}
.kv{display:flex;justify-content:space-between;gap:10px;padding:6px 0;font-size:13px}
.kv .k{color:var(--muted)}
.kv .v{font-weight:600;text-align:right}
.tags{display:flex;flex-wrap:wrap;gap:6px}

/* ---------- Flows ---------- */
.flow-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.flow-toolbar .spacer{flex:1}
.flow-layout{display:grid;grid-template-columns:190px 1fr 280px;gap:16px;align-items:start}
.palette .pal-item{
  display:flex;gap:9px;align-items:center;background:#fff;border:1px solid var(--border);
  border-radius:10px;padding:10px 12px;margin-bottom:8px;font-size:13px;font-weight:600;cursor:grab;
}
.palette .pal-item:hover{border-color:var(--primary)}
.palette .pal-icon{width:28px;height:28px;border-radius:8px;background:var(--primary-soft);
  color:var(--primary);display:flex;align-items:center;justify-content:center;flex:0 0 28px}
.canvas-wrap{
  background:#fff;border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);
  overflow:auto;
}
.canvas{
  position:relative;width:1080px;height:600px;
  background-image:radial-gradient(circle,#E7E4F0 1.2px,transparent 1.2px);
  background-size:22px 22px;
}
.canvas svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.node{
  position:absolute;width:210px;background:#fff;border:1px solid var(--border);border-radius:12px;
  box-shadow:0 1px 3px rgba(33,29,46,.08);cursor:grab;user-select:none;
}
.node:active{cursor:grabbing}
.node.selected{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}
.node-head{
  background:var(--primary);color:#fff;font-size:12px;font-weight:700;
  padding:7px 12px;border-radius:11px 11px 0 0;display:flex;gap:7px;align-items:center;
}
.node-trigger .node-head{background:var(--accent);color:#211D2E}
.node-body{padding:11px 12px;font-size:13px}
.node-body .n-title{font-weight:700;margin-bottom:2px}
.node-body .n-desc{color:var(--muted);font-size:12px}
.port{
  position:absolute;width:14px;height:14px;border-radius:50%;background:#fff;
  border:2.5px solid var(--primary);top:50%;margin-top:-7px;
}
.port-in{left:-7px}
.port-out{right:-7px}
.port-true{border-color:var(--success);top:32%}
.port-false{border-color:var(--danger);top:68%}
.port-label{position:absolute;font-size:10px;font-weight:800;top:50%;margin-top:-6px}
.port-label-true{right:12px;color:var(--success)}
.port-label-false{right:12px;color:var(--danger)}
.inspector label{display:block;font-size:12px;font-weight:700;color:var(--muted);margin:12px 0 5px}
.inspector input,.inspector select,.inspector textarea{
  width:100%;border:1px solid var(--border);border-radius:9px;padding:9px 11px;background:#fff;
}
.inspector textarea{min-height:74px;resize:vertical}
.template-list{list-style:none}
.template-list li{display:flex;justify-content:space-between;align-items:center;gap:8px;
  padding:10px 0;border-bottom:1px solid var(--border);font-size:13px}
.template-list li:last-child{border-bottom:none}

/* ---------- Campaigns ---------- */
.delivery-panel .meters{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:14px 0}
.meter{background:var(--bg);border-radius:10px;padding:12px;text-align:center}
.meter .m-val{font-size:22px;font-weight:800}
.meter .m-lab{font-size:12px;color:var(--muted)}
.meter.sent .m-val{color:var(--info)}
.meter.delivered .m-val{color:var(--primary)}
.meter.read .m-val{color:var(--success)}
.meter.failed .m-val{color:var(--danger)}
.progress{height:8px;background:var(--bg);border-radius:4px;overflow:hidden;margin:6px 0 2px}
.progress > span{display:block;height:100%;background:var(--primary);border-radius:4px}
.progress .seg-delivered{background:var(--primary)}
.progress .seg-read{background:var(--success)}
.progress .seg-failed{background:var(--danger)}

/* ---------- Responsive ---------- */
@media (max-width:1100px){
  .stat-grid{grid-template-columns:repeat(2,1fr)}
  .grid-3{grid-template-columns:1fr 1fr}
  .inbox{grid-template-columns:260px 1fr}
  .contact-panel{display:none}
  .flow-layout{grid-template-columns:170px 1fr}
  .inspector{grid-column:1 / -1}
}
@media (max-width:850px){
  .sidebar{transform:translateX(-100%)}
  .sidebar.open{transform:translateX(0);box-shadow:0 0 40px rgba(0,0,0,.35)}
  .main{margin-left:0}
  .hamburger{display:block}
  .content{padding:18px 16px 40px}
  .topbar{padding:10px 16px;flex-wrap:wrap}
  .search{order:3;flex-basis:100%;max-width:none}
  .status-pills{display:none}
  .stat-grid,.grid-2,.grid-3{grid-template-columns:1fr}
  .inbox{grid-template-columns:1fr;height:auto}
  .inbox-list{border-right:none;border-bottom:1px solid var(--border)}
  .convs{max-height:300px}
  .messages{min-height:300px}
  .flow-layout{grid-template-columns:1fr}
  .canvas-wrap{overflow-x:auto}
}
.sidebar-overlay{
  display:none;position:fixed;inset:0;background:rgba(33,29,46,.45);z-index:45;
}
.sidebar-overlay.show{display:block}

/* ==================================================================
   AUTO DADY AI — app.css extensions (Frontend child)
   Extends the Aurora Violet preview theme above: forms, modals,
   toasts, tabs, empty states, auth + public-site layouts, storefront,
   settings, admin, canvas extras. No external font fetch.
   ================================================================== */

/* ---------- Forms ---------- */
.field{margin-bottom:14px}
.field label{display:block;font-size:12px;font-weight:700;color:var(--muted);margin-bottom:5px}
.field input,.field select,.field textarea{
  width:100%;border:1px solid var(--border);border-radius:10px;padding:10px 12px;
  background:#fff;outline:none;
}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}
.field textarea{min-height:80px;resize:vertical}
.field .hint{font-size:12px;color:var(--muted);margin-top:4px}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}

/* ---------- Password visibility toggle (eye) ---------- */
/* Every password input the user types is wrapped in .pw-wrap with a
   .pw-toggle button (type="button", so it never submits the form).
   The button is a 40px tap target, violet on hover, and swaps the
   eye / eye-off icon via aria-pressed. Secret fields (API keys,
   tokens, SMTP password) deliberately have NO toggle. */
.pw-wrap{position:relative}
.pw-wrap input{padding-right:46px}
.pw-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:40px;height:40px;display:flex;align-items:center;justify-content:center;background:none;border:none;border-radius:9px;color:var(--muted)}
.pw-toggle:hover{background:var(--primary-soft);color:var(--primary-deep)}
.pw-toggle:focus-visible{outline:2px solid var(--primary);outline-offset:1px}
.pw-toggle .pw-eye-off{display:none}
.pw-toggle[aria-pressed="true"] .pw-eye-on{display:none}
.pw-toggle[aria-pressed="true"] .pw-eye-off{display:block}
@media (max-width:700px){.field-row{grid-template-columns:1fr}}
.form-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.check-row{display:flex;align-items:center;gap:9px;font-size:14px;margin:10px 0}
.check-row input{width:17px;height:17px;accent-color:var(--primary)}

/* ---------- Buttons (extra) ---------- */
.btn-accent{background:var(--accent);color:#211D2E}
.btn-accent:hover{background:#D97706;color:#fff;text-decoration:none}
.btn-danger{background:var(--danger);color:#fff}
.btn-block{width:100%;justify-content:center}
.btn[disabled]{opacity:.55;cursor:not-allowed}
.link-btn{background:none;border:none;color:var(--primary);font-weight:600;font-size:13px;padding:0}
.link-btn:hover{text-decoration:underline}
.link-btn.danger{color:var(--danger)}

/* ---------- Toasts ---------- */
#toasts{position:fixed;right:20px;bottom:20px;z-index:200;display:flex;flex-direction:column;gap:10px;max-width:380px}
.toast{
  background:var(--ink);color:#fff;border-radius:12px;padding:12px 16px;font-size:14px;
  box-shadow:0 8px 24px rgba(33,29,46,.28);display:flex;gap:10px;align-items:flex-start;
}
.toast.err{background:#7F1D1D}
.toast.ok{background:#14532D}
.toast .t-x{margin-left:auto;background:none;border:none;color:#fff;font-size:16px;line-height:1}

/* ---------- Modal ---------- */
.modal-backdrop{
  position:fixed;inset:0;background:rgba(33,29,46,.5);z-index:100;
  display:flex;align-items:center;justify-content:center;padding:20px;
}
.modal{background:#fff;border-radius:var(--radius);box-shadow:0 16px 48px rgba(0,0,0,.3);
  width:100%;max-width:560px;max-height:88vh;overflow-y:auto;padding:22px}
.modal.wide{max-width:760px}
.modal h3{font-size:17px;margin-bottom:4px}
.modal .m-sub{color:var(--muted);font-size:13px;margin-bottom:14px}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.modal-x{background:none;border:none;font-size:20px;color:var(--muted);line-height:1}

/* ---------- Tabs ---------- */
.tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px}
.tab{border:1px solid var(--border);background:#fff;border-radius:999px;padding:7px 15px;font-size:13px;font-weight:600;color:var(--muted);cursor:pointer}
.tab.active{background:var(--primary);border-color:var(--primary);color:#fff}
.tab:hover{border-color:var(--primary);color:var(--primary)}
.tab.active:hover{color:#fff}

/* ---------- Empty / loading / error states ---------- */
.empty{padding:34px 20px;text-align:center;color:var(--muted)}
.empty .e-icon{font-size:32px;margin-bottom:8px}
.empty .e-title{font-weight:700;color:var(--ink);font-size:15px;margin-bottom:4px}
.empty p{font-size:13px;max-width:460px;margin:0 auto 14px}
.loading{padding:34px;text-align:center;color:var(--muted)}
.error-box{background:#FEF2F2;border:1px solid #FECACA;color:#991B1B;border-radius:var(--radius);padding:14px 16px;font-size:14px;margin-bottom:16px}
.notice-box{background:var(--accent-soft);border:1px solid #FDE68A;color:#92400E;border-radius:var(--radius);padding:12px 16px;font-size:13px;margin-bottom:16px}
.info-box{background:#EFF6FF;border:1px solid #BFDBFE;color:#1E40AF;border-radius:var(--radius);padding:12px 16px;font-size:13px;margin-bottom:16px}
.success-box{background:#F0FDF4;border:1px solid #BBF7D0;color:#166534;border-radius:var(--radius);padding:12px 16px;font-size:13px;margin-bottom:16px}

/* ---------- Section header / toolbar ---------- */
.page-head{display:flex;align-items:flex-start;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.page-head h1{font-size:22px;font-weight:800;line-height:1.2}
.page-head .p-sub{color:var(--muted);font-size:14px;margin-top:3px;max-width:640px}
.page-head .spacer{flex:1}
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.toolbar input[type="search"],.toolbar input[type="text"],.toolbar select{
  border:1px solid var(--border);border-radius:10px;padding:9px 12px;background:#fff;outline:none;
}
.toolbar input:focus,.toolbar select:focus{border-color:var(--primary)}
.kv-list{list-style:none}
.kv-list li{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--border);font-size:14px}
.kv-list li:last-child{border-bottom:none}
.kv-list .k{color:var(--muted)}
.kv-list .v{font-weight:600;text-align:right;word-break:break-word}

/* ---------- Stat tiles (extra sizes) ---------- */
.stat-grid-4{grid-template-columns:repeat(4,1fr)}
@media (max-width:1100px){.stat-grid-4{grid-template-columns:repeat(2,1fr)}}
@media (max-width:700px){.stat-grid-4{grid-template-columns:1fr}}
.stat small{display:block;color:var(--muted);font-size:12px;margin-top:2px}

/* ---------- Badges / status chips ---------- */
.chip{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:700;padding:3px 10px;border-radius:999px;white-space:nowrap}
.chip-green{background:#DCFCE7;color:#15803D}
.chip-amber{background:var(--accent-soft);color:#92400E}
.chip-red{background:#FEE2E2;color:#B91C1C}
.chip-violet{background:var(--primary-soft);color:var(--primary-deep)}
.chip-grey{background:#EDE9F5;color:var(--muted)}
.chip-blue{background:#E0F2FE;color:#0369A1}

/* ---------- Flow canvas (real editor extras) ---------- */
.flow-editor{display:grid;grid-template-columns:200px 1fr 300px;gap:16px;align-items:start}
@media (max-width:1100px){.flow-editor{grid-template-columns:170px 1fr}.flow-inspector{grid-column:1 / -1}}
@media (max-width:850px){.flow-editor{grid-template-columns:1fr}}
.canvas-wrap{position:relative}
.canvas-viewport{position:relative;width:100%;height:620px;overflow:hidden;background:#fff;
  border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);
  background-image:radial-gradient(circle,#E7E4F0 1.2px,transparent 1.2px);background-size:22px 22px;
  cursor:grab;touch-action:none}
.canvas-viewport.panning{cursor:grabbing}
.canvas-world{position:absolute;left:0;top:0;transform-origin:0 0}
.canvas-world svg{position:absolute;overflow:visible;pointer-events:none}
.canvas-world svg path.edge{pointer-events:stroke;cursor:pointer}
.canvas-world svg path.edge:hover{stroke-width:3.5}
.canvas-world svg path.edge.sel{stroke-width:3.5}
.flow-node{position:absolute;width:220px;background:#fff;border:1px solid var(--border);
  border-radius:12px;box-shadow:0 1px 3px rgba(33,29,46,.08);cursor:grab;user-select:none}
.flow-node:active{cursor:grabbing}
.flow-node.selected{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}
.flow-node.is-start{border-color:var(--accent)}
.flow-node .node-head{background:var(--primary);color:#fff;font-size:12px;font-weight:700;
  padding:7px 12px;border-radius:11px 11px 0 0;display:flex;gap:7px;align-items:center}
.flow-node.trigger-node .node-head{background:var(--accent);color:#211D2E}
.flow-node .node-body{padding:11px 12px;font-size:13px}
.flow-node .n-title{font-weight:700;margin-bottom:2px}
.flow-node .n-desc{color:var(--muted);font-size:12px;word-break:break-word}
.flow-port{position:absolute;width:16px;height:16px;border-radius:50%;background:#fff;
  border:2.5px solid var(--primary);cursor:crosshair;z-index:3}
.flow-port:hover{transform:scale(1.25)}
.flow-port.in{left:-8px;top:50%;margin-top:-8px}
.flow-port.out{right:-8px;top:50%;margin-top:-8px}
.flow-port.true{right:-8px;top:30%;margin-top:-8px;border-color:var(--success)}
.flow-port.false{right:-8px;top:70%;margin-top:-8px;border-color:var(--danger)}
.flow-port.pending{background:var(--accent);border-color:var(--accent)}
.flow-port-label{position:absolute;font-size:10px;font-weight:800;top:50%;margin-top:-6px;pointer-events:none}
.flow-port-label.true{right:12px;color:var(--success);top:30%}
.flow-port-label.false{right:12px;color:var(--danger);top:70%}
.canvas-hud{position:absolute;left:12px;top:12px;z-index:5;display:flex;gap:6px;flex-wrap:wrap}
.canvas-hud .btn{background:#fff}
.canvas-zoom{position:absolute;right:12px;top:12px;z-index:5;display:flex;gap:6px;align-items:center;
  background:#fff;border:1px solid var(--border);border-radius:10px;padding:4px 8px;font-size:13px;font-weight:700}
.canvas-zoom button{background:none;border:none;font-size:15px;padding:2px 8px;color:var(--primary)}
.palette-item{display:flex;gap:9px;align-items:center;background:#fff;border:1px solid var(--border);
  border-radius:10px;padding:10px 12px;margin-bottom:8px;font-size:13px;font-weight:600;cursor:grab;width:100%;text-align:left}
.palette-item:hover{border-color:var(--primary)}
.palette-item .pal-icon{width:28px;height:28px;border-radius:8px;background:var(--primary-soft);
  color:var(--primary);display:flex;align-items:center;justify-content:center;flex:0 0 28px}
.inspector label{display:block;font-size:12px;font-weight:700;color:var(--muted);margin:12px 0 5px}
.inspector input,.inspector select,.inspector textarea{
  width:100%;border:1px solid var(--border);border-radius:9px;padding:9px 11px;background:#fff}
.inspector textarea{min-height:74px;resize:vertical}
.edge-hint{font-size:12px;color:var(--muted);margin-top:8px}

/* ---------- Auth pages ---------- */
.auth-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;
  background:linear-gradient(160deg,#241B3A 0%,#4527B8 55%,#5B3EDB 100%)}
.auth-card{background:#fff;border-radius:18px;box-shadow:0 20px 60px rgba(0,0,0,.35);
  width:100%;max-width:430px;padding:32px 30px}
.auth-card .logo-mark{margin-bottom:14px}
.auth-card h1{font-size:22px;font-weight:800;margin-bottom:4px}
.auth-card .a-sub{color:var(--muted);font-size:14px;margin-bottom:22px}
.auth-card .a-foot{margin-top:18px;text-align:center;font-size:13px;color:var(--muted)}

/* ---------- Public site ---------- */
.site-header{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.96);backdrop-filter:blur(6px);
  border-bottom:1px solid var(--border)}
.site-header .inner{max-width:1120px;margin:0 auto;padding:14px 22px;display:flex;align-items:center;gap:20px}
.site-brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:17px;color:var(--ink)}
.site-brand:hover{text-decoration:none}
.site-nav{display:flex;gap:4px;margin-left:auto;flex-wrap:wrap}
.site-nav a{color:var(--ink);font-weight:600;font-size:14px;padding:8px 12px;border-radius:9px}
.site-nav a:hover{background:var(--primary-soft);color:var(--primary-deep);text-decoration:none}
.site-nav a.cta{background:var(--primary);color:#fff}
.site-nav a.cta:hover{background:var(--primary-deep)}

/* ---------- Public site: mobile header (hamburger nav) ---------- */
/* At <=850px the 7-link nav would wrap into ragged columns and the brand
   into 3 lines (seen on a 390px phone). Instead the brand stays on one
   line and the nav hides behind a hamburger that opens a drop-down panel.
   The toggle button is wired by public/assets/js/public.js (external —
   the CSP blocks inline scripts). Desktop layout is untouched. */
.nav-toggle{display:none}
@media (max-width:850px){
  .site-header .inner{padding:10px 16px;gap:12px}
  .site-brand{font-size:15px;white-space:nowrap}
  .site-brand .logo-mark{width:34px;height:34px;flex-basis:34px;font-size:16px}
  .nav-toggle{display:flex;align-items:center;justify-content:center;margin-left:auto;
    width:38px;height:38px;flex:0 0 38px;background:none;border:1px solid var(--border);
    border-radius:9px;font-size:18px;color:var(--ink);cursor:pointer}
  .site-nav{display:none}
  .site-nav.open{display:flex;position:absolute;top:100%;left:0;right:0;flex-direction:column;
    gap:2px;margin-left:0;background:#fff;border-bottom:1px solid var(--border);
    padding:8px 16px 14px;box-shadow:0 18px 30px rgba(33,29,46,.12)}
  .site-nav.open a{padding:11px 12px;font-size:15px}
  .site-nav.open a.cta{text-align:center;margin-top:6px}
  .hero{padding:44px 0 32px}
  .site-main{padding:0 16px 48px}
  .site-footer{padding:22px 16px}
}
@media (max-width:480px){
  .hero h1{font-size:28px}
  .hero p{font-size:16px}
  .section-block h2{font-size:23px}
  .auth-wrap{padding:16px}
  .auth-card{padding:24px 20px}
}
.site-main{max-width:1120px;margin:0 auto;padding:0 22px 64px}
.hero{padding:72px 0 48px;text-align:center}
.hero h1{font-size:44px;line-height:1.12;font-weight:800;letter-spacing:-.01em}
.hero h1 .hl{color:var(--primary)}
.hero p{font-size:18px;color:var(--muted);max-width:640px;margin:18px auto 26px}
.hero-cta{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
.hero .btn{padding:12px 22px;font-size:15px}
.feature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:36px}
@media (max-width:850px){.feature-grid{grid-template-columns:1fr}.hero h1{font-size:32px}}
.feature-card h3{font-size:16px;margin:10px 0 6px}
.feature-card p{color:var(--muted);font-size:14px}
.feature-icon{width:46px;height:46px;border-radius:13px;background:var(--primary-soft);color:var(--primary);
  display:flex;align-items:center;justify-content:center;font-size:22px}
.section-block{padding:44px 0 8px}
.section-block h2{font-size:28px;font-weight:800;margin-bottom:10px}
.section-block .lead{color:var(--muted);font-size:16px;max-width:680px}
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:28px}
@media (max-width:850px){.steps{grid-template-columns:1fr}}
.step-num{width:34px;height:34px;border-radius:50%;background:var(--accent);color:#211D2E;
  display:flex;align-items:center;justify-content:center;font-weight:800;margin-bottom:10px}
.site-footer{border-top:1px solid var(--border);padding:32px 22px 24px;color:var(--muted);font-size:13px}
.site-footer a{color:var(--muted)}
.site-footer a:hover{color:var(--primary)}
.footer-inner{max-width:1080px;margin:0 auto;display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:24px;text-align:left}
.footer-brand p{margin:12px 0 0;line-height:1.5}
.footer-col h4{margin:0 0 10px;font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--ink)}
.footer-col a{display:block;margin:0 0 8px;overflow-wrap:anywhere}
.footer-copy{max-width:1080px;margin:24px auto 0;padding-top:16px;border-top:1px solid var(--border);text-align:center}
@media (max-width:850px){.footer-inner{grid-template-columns:1fr 1fr}}
@media (max-width:480px){.footer-inner{grid-template-columns:1fr}}
.price-card .p-was{text-decoration:line-through;color:var(--muted);font-size:22px;font-weight:600}
.price-card .p-sale{font-size:38px;font-weight:800}
.p-badge{display:inline-block;background:var(--accent);color:#241B3A;font-size:12px;font-weight:800;padding:3px 8px;border-radius:999px;vertical-align:middle;letter-spacing:.04em;white-space:nowrap}
.pricing-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:28px}
@media (max-width:850px){.pricing-grid{grid-template-columns:1fr}}
.price-card{text-align:center}
.price-card .p-name{font-size:15px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--primary-deep)}
.price-card .p-price{font-size:38px;font-weight:800;margin:12px 0 4px}
.price-card .p-per{color:var(--muted);font-size:13px}
.price-card ul{list-style:none;text-align:left;margin:18px 0}
.price-card li{padding:7px 0;border-bottom:1px solid var(--border);font-size:14px}
.price-card li:last-child{border-bottom:none}
.price-card.featured{border:2px solid var(--primary)}

/* ---------- Storefront (public shop) ---------- */
.shop-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:24px}
@media (max-width:850px){.shop-grid{grid-template-columns:1fr 1fr}}
@media (max-width:560px){.shop-grid{grid-template-columns:1fr}}
.product-card .p-title{font-weight:700;font-size:15px}
.product-card .p-price{font-size:18px;font-weight:800;color:var(--primary-deep);margin:6px 0}
.product-card .p-desc{color:var(--muted);font-size:13px}
.cart-bar{position:sticky;bottom:16px;background:var(--ink);color:#fff;border-radius:14px;
  padding:14px 18px;display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:24px}
.cart-bar .spacer{flex:1}

/* ---------- Misc ---------- */
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;word-break:break-all}
.copy-row{display:flex;gap:8px;align-items:center}
.copy-row code{flex:1;background:var(--bg);border:1px solid var(--border);border-radius:9px;padding:9px 11px;word-break:break-all;font-size:13px}
pre.code{background:#211D2E;color:#EDE9FD;border-radius:12px;padding:16px;overflow-x:auto;font-size:13px;line-height:1.55}
.table-wrap .num{text-align:right}
.progress-sm{height:8px;background:var(--bg);border-radius:4px;overflow:hidden}
.progress-sm > span{display:block;height:100%;background:var(--primary)}
.avatar-sm{width:30px;height:30px;border-radius:50%;background:var(--primary);color:#fff;
  display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;flex:0 0 30px}
.row-flex{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.mt{margin-top:16px}.mb{margin-bottom:16px}
.hidden{display:none !important}
