
  :root{ --blue:#0b3d91; --blue-d:#082c6b; --acc:#1f6feb; --tint:#eaf1fb; --ink:#14213d; --muted:#5f6b85; --rule:#e2e7f0; --bg:#f4f6fb; --wa-out:#d9fdd3;
    --ok:#1f7a45; --ok-t:#e2f2e8; --red:#b3261e; --red-t:#fbe9e7; --amber:#8a5a0c; --amber-t:#fbf1d6; --violet:#5b3cc4; --violet-t:#efeafd;
    --shadow:0 6px 18px rgba(11,61,145,.07),0 2px 4px rgba(11,61,145,.04); }
  *{ box-sizing:border-box; margin:0; padding:0; }
  body{ font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; color:var(--ink); background:var(--bg); display:flex; height:100vh; overflow:hidden; font-size:14px; }
  button,input,select,textarea{ font-family:inherit; font-size:13.5px; }
  .side{ width:214px; background:var(--blue-d); color:#fff; flex:0 0 214px; display:flex; flex-direction:column; padding:16px 0; }
  .side .brand{ display:flex; align-items:center; gap:10px; padding:4px 18px 16px; font-weight:800; font-size:16px; }
  .side .brand .logo{ width:34px; height:34px; border-radius:9px; background:#fff; color:var(--blue); display:flex; align-items:center; justify-content:center; font-weight:900; font-size:14px; }
  .side .brand small{ display:block; font-weight:500; font-size:10.5px; opacity:.6; letter-spacing:2px; text-transform:uppercase; margin-top:2px; }
  .side nav a{ display:flex; align-items:center; gap:10px; padding:10px 20px; color:#d8e3f7; text-decoration:none; font-size:14px; cursor:pointer; border-left:3px solid transparent; }
  .side nav a:hover{ background:rgba(255,255,255,.06); }
  .side nav a.active{ background:rgba(255,255,255,.11); border-left-color:#7fb3ff; color:#fff; font-weight:600; }
  .side nav a i{ font-style:normal; width:20px; text-align:center; }
  .side nav .sep{ height:1px; background:rgba(255,255,255,.1); margin:8px 18px; }
  .side .me{ margin-top:auto; padding:12px 18px; font-size:12.5px; border-top:1px solid rgba(255,255,255,.1); }
  .side .me b{ display:block; font-size:13.5px; }
  .side .me button{ margin-top:8px; background:rgba(255,255,255,.12); color:#fff; border:0; border-radius:7px; padding:5px 10px; cursor:pointer; font-size:12px; }
  .main{ flex:1; display:flex; flex-direction:column; min-width:0; }
  .top{ background:#fff; border-bottom:1px solid var(--rule); padding:14px 24px; display:flex; align-items:center; gap:12px; }
  .top h1{ font-size:19px; }
  .top p{ font-size:12.5px; color:var(--muted); }
  .top .sp{ flex:1; }
  .role{ font-size:11.5px; font-weight:700; letter-spacing:.5px; padding:4px 10px; border-radius:999px; }
  .role.admin{ background:#dbe8ff; color:var(--blue); } .role.agent{ background:var(--ok-t); color:var(--ok); }
  .proto{ font-size:11px; background:var(--amber-t); color:var(--amber); padding:4px 9px; border-radius:7px; font-weight:600; }
  #view{ flex:1; overflow:auto; }
  .wrap{ padding:20px 24px 40px; }
  .card{ background:#fff; border:1px solid var(--rule); border-radius:12px; padding:16px 18px; box-shadow:var(--shadow); }
  .card h3{ font-size:14.5px; margin-bottom:4px; }
  .hint{ font-size:12.5px; color:var(--muted); line-height:1.45; }
  .banner{ background:var(--tint); border:1px solid #cfdcf3; color:#22355e; border-radius:10px; padding:10px 14px; font-size:13px; margin-bottom:16px; line-height:1.5; }
  .banner.warn{ background:var(--amber-t); border-color:#efdca8; color:#5c4100; }
  .grid{ display:grid; gap:16px; }
  .g2{ grid-template-columns:1fr 1fr; } .g3{ grid-template-columns:repeat(3,1fr); } .g32{ grid-template-columns:3fr 2fr; }
  .kpis{ display:grid; grid-template-columns:repeat(6,1fr); gap:12px; margin-bottom:16px; }
  .kpi{ background:#fff; border:1px solid var(--rule); border-radius:12px; padding:12px 14px; box-shadow:var(--shadow); }
  .kpi .l{ font-size:12px; color:var(--muted); } .kpi .n{ font-size:22px; font-weight:800; margin-top:4px; } .kpi .d{ font-size:11.5px; margin-top:2px; color:var(--ok); }
  .kpi .d.down{ color:var(--red); }
  table{ width:100%; border-collapse:collapse; background:#fff; }
  th{ text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); padding:9px 10px; border-bottom:1px solid var(--rule); background:#fafbfe; font-weight:600; }
  td{ padding:9px 10px; border-bottom:1px solid #f0f2f7; font-size:13.5px; vertical-align:middle; }
  tr.click{ cursor:pointer; } tr.click:hover td{ background:#f7f9fe; }
  .num{ text-align:right; font-variant-numeric:tabular-nums; }
  .tblwrap{ border:1px solid var(--rule); border-radius:12px; overflow:auto; background:#fff; box-shadow:var(--shadow); }
  .pill{ display:inline-block; font-size:11.5px; font-weight:600; padding:2px 9px; border-radius:999px; white-space:nowrap; }
  .p-ok{ background:var(--ok-t); color:var(--ok); } .p-red{ background:var(--red-t); color:var(--red); } .p-amb{ background:var(--amber-t); color:var(--amber); }
  .p-blue{ background:#dbe8ff; color:var(--blue); } .p-vio{ background:var(--violet-t); color:var(--violet); } .p-grey{ background:#eef0f4; color:#56607a; }
  .btn{ background:var(--blue); color:#fff; border:0; border-radius:8px; padding:8px 14px; font-weight:600; cursor:pointer; }
  .btn:hover{ background:var(--blue-d); }
  .btn.ghost{ background:#fff; color:var(--blue); border:1px solid #c9d6ee; }
  .btn.ghost:hover{ background:var(--tint); }
  .btn:disabled{ opacity:.45; cursor:not-allowed; }
  label.f{ display:block; font-size:12.5px; font-weight:600; margin:12px 0 5px; color:#2b3a5c; }
  input.i, select.i, textarea.i{ width:100%; padding:8px 10px; border:1px solid var(--rule); border-radius:8px; background:#fff; }
  textarea.i{ resize:vertical; line-height:1.45; }
  .mono{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12.5px; }
  .masked{ font-family:ui-monospace,monospace; letter-spacing:.3px; }
  .lock{ font-size:11px; color:var(--red); margin-left:4px; }
  .chips{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
  .chip{ border:1px solid var(--rule); background:#fff; border-radius:999px; padding:5px 12px; font-size:12.5px; cursor:pointer; color:#3b4868; }
  .chip.on{ background:var(--blue); color:#fff; border-color:var(--blue); }
  /* inbox */
  .inbox{ display:grid; grid-template-columns:300px 1fr 280px; height:calc(100vh - 67px); }
  .clist{ border-right:1px solid var(--rule); background:#fff; overflow:auto; }
  .clist .search{ padding:10px; border-bottom:1px solid var(--rule); position:sticky; top:0; background:#fff; z-index:1; }
  .crow{ padding:11px 14px; border-bottom:1px solid #f0f2f7; cursor:pointer; display:flex; gap:10px; }
  .crow:hover{ background:#f7f9fe; } .crow.on{ background:var(--tint); }
  .av{ width:36px; height:36px; border-radius:50%; background:#c9d9f5; color:var(--blue); display:flex; align-items:center; justify-content:center; font-weight:700; flex:0 0 36px; font-size:13px; }
  .crow .nm{ font-weight:600; font-size:13.5px; display:flex; gap:6px; align-items:center; }
  .crow .lt{ font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; max-width:200px; }
  .thread{ display:flex; flex-direction:column; background:#efeae2; min-width:0; }
  .thead{ background:#fff; padding:10px 16px; border-bottom:1px solid var(--rule); display:flex; align-items:center; gap:10px; }
  .msgs{ flex:1; overflow:auto; padding:14px 18px; display:flex; flex-direction:column; gap:6px; }
  .m{ max-width:70%; padding:7px 10px; border-radius:8px; font-size:13.5px; line-height:1.4; white-space:pre-wrap; box-shadow:0 1px 1px rgba(0,0,0,.06); }
  .m.in{ background:#fff; align-self:flex-start; } .m.out{ background:var(--wa-out); align-self:flex-end; } .m.agent{ background:#e3f0ff; align-self:flex-end; }
  .m .meta{ font-size:10.5px; color:#7b8798; margin-top:3px; text-align:right; }
  .m.note{ align-self:center; background:#fff7d6; color:#6b5200; font-size:12px; }
  .compose{ background:#fff; border-top:1px solid var(--rule); padding:10px; display:flex; gap:8px; }
  .compose input{ flex:1; padding:10px 12px; border:1px solid var(--rule); border-radius:20px; }
  .cside{ background:#fff; border-left:1px solid var(--rule); padding:16px; overflow:auto; }
  .kv{ display:grid; grid-template-columns:96px 1fr; gap:6px 8px; font-size:13px; margin-top:8px; }
  .kv span:nth-child(odd){ color:var(--muted); }
  /* kanban */
  .kan{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
  .col{ background:#eef2f9; border-radius:12px; padding:10px; min-height:200px; }
  .col h4{ font-size:13px; margin:2px 4px 10px; display:flex; justify-content:space-between; }
  .lc{ background:#fff; border-radius:10px; padding:10px 12px; margin-bottom:8px; box-shadow:0 1px 2px rgba(0,0,0,.06); font-size:13px; }
  .lc .s{ font-size:12px; color:var(--muted); margin-top:3px; }
  /* campaign preview phone */
  .pv{ background:#efeae2; border-radius:14px; padding:14px; min-height:260px; }
  .pv .b{ background:#fff; border-radius:8px; padding:8px 10px; font-size:13px; line-height:1.4; white-space:pre-wrap; max-width:92%; box-shadow:0 1px 1px rgba(0,0,0,.06); }
  .pv .hi{ height:90px; border-radius:6px; margin:-2px -4px 8px; background:linear-gradient(135deg,#0b3d91,#1f6feb 60%,#5aa9ff); color:#fff; display:flex; align-items:flex-end; padding:8px; font-weight:700; }
  .pv .qb{ background:#fff; border-radius:8px; padding:7px; text-align:center; color:#0a84c6; font-size:13px; margin-top:4px; max-width:92%; box-shadow:0 1px 1px rgba(0,0,0,.06); }
  .bar{ height:8px; background:#e8edf6; border-radius:5px; overflow:hidden; } .bar i{ display:block; height:100%; background:var(--acc); border-radius:5px; }
  .sw{ position:relative; display:inline-block; width:38px; height:22px; flex:0 0 38px; }
  .sw input{ opacity:0; width:0; height:0; }
  .sw .sl{ position:absolute; inset:0; background:#c7cfdd; border-radius:22px; cursor:pointer; transition:.2s; }
  .sw .sl::before{ content:""; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; }
  .sw input:checked + .sl{ background:var(--blue); } .sw input:checked + .sl::before{ transform:translateX(16px); }
  .modal{ position:fixed; inset:0; background:rgba(10,20,40,.45); display:flex; align-items:flex-start; justify-content:center; z-index:60; overflow:auto; padding:40px 16px; }
  .modal > div{ background:#fff; border-radius:14px; padding:22px; width:100%; max-width:560px; box-shadow:0 20px 60px rgba(0,0,0,.25); }
  .toast{ position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:#14213d; color:#fff; padding:10px 16px; border-radius:10px; font-size:13px; z-index:80; box-shadow:0 6px 20px rgba(0,0,0,.25); }
  /* login */
  #login{ position:fixed; inset:0; background:linear-gradient(135deg,#082c6b,#0b3d91 50%,#1f6feb); display:flex; align-items:center; justify-content:center; z-index:100; padding:20px; }
  #login .box{ background:#fff; border-radius:16px; padding:28px; max-width:520px; width:100%; box-shadow:0 30px 80px rgba(0,0,0,.35); }
  #login h2{ font-size:20px; margin:8px 0 4px; }
  .ucard{ display:flex; gap:12px; align-items:center; border:1px solid var(--rule); border-radius:12px; padding:12px 14px; margin-top:10px; cursor:pointer; }
  .ucard:hover{ border-color:var(--acc); background:#f7faff; }
  .ucard .av{ width:42px; height:42px; flex:0 0 42px; }
  .flowsvg text{ font-family:-apple-system,"Segoe UI",Roboto,Arial,sans-serif; }
  @media (max-width:1100px){ .kpis{ grid-template-columns:repeat(3,1fr); } .g2,.g3,.g32,.kan{ grid-template-columns:1fr; } .inbox{ grid-template-columns:240px 1fr; } .cside{ display:none; } }

  .kan{ grid-template-columns:repeat(5,minmax(180px,1fr)); overflow-x:auto; }
  .filters{ display:flex; gap:8px; align-items:center; }
  .filters select{ padding:6px 10px; border:1px solid var(--rule); border-radius:8px; background:#fff; font-weight:600; color:var(--ink); }
  .role.exec{ background:#ede7ff; color:#4b2bb8; } .role.manager{ background:#fff1d6; color:#8a5a0c; }
  .sla-ok{ color:var(--ok); font-weight:600; } .sla-warn{ color:var(--amber); font-weight:600; } .sla-bad{ color:var(--red); font-weight:600; }
  .best td{ background:#f1f9f4; }
  .bt{ font-size:11px; font-weight:700; padding:1px 7px; border-radius:6px; background:#eef2f9; color:#3b4868; }
  .lc.overdue{ border:1.5px solid #e39a92; }
  .lc.closed{ opacity:.8; background:#fbfbfd; }
  .legend{ display:flex; gap:14px; flex-wrap:wrap; font-size:12.5px; color:var(--muted); margin-top:6px; }
  .legend i{ display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:5px; vertical-align:-1px; }

  .loginwrap{ position:fixed; inset:0; background:linear-gradient(135deg,#082c6b,#0b3d91 50%,#1f6feb); display:flex; align-items:center; justify-content:center; z-index:100; padding:20px; }
  .loginwrap .box{ background:#fff; border-radius:16px; padding:28px; max-width:460px; width:100%; box-shadow:0 30px 80px rgba(0,0,0,.35); }
  .demo-users{ display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:10px; }
  .demo-users button{ text-align:left; border:1px solid var(--rule); background:#fff; border-radius:8px; padding:7px 9px; cursor:pointer; font-size:12.5px; }
  .demo-users button:hover{ border-color:var(--acc); background:#f7faff; }
  .err{ color:var(--red); font-size:13px; margin-top:8px; min-height:18px; }
  .live{ display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--ok); font-weight:600; }
  .live::before{ content:""; width:8px; height:8px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 3px #dcfce7; }
  .m .tplh{ font-size:10.5px; color:#8696a0; text-transform:uppercase; letter-spacing:1px; margin-bottom:3px; }
  .m .opts{ margin-top:6px; display:flex; flex-wrap:wrap; gap:4px; }
  .m .opts span{ font-size:11.5px; border:1px solid #c9d6ee; color:#0a84c6; border-radius:6px; padding:1px 7px; background:#fff; }
  .empty{ padding:30px; text-align:center; color:var(--muted); }

  /* account opening */
  tr.click{ cursor:pointer; } tr.click:hover td{ background:#f7f9fd; }
  .funnel .fr{ display:grid; grid-template-columns:150px 1fr 40px 48px; gap:10px; align-items:center; padding:4px 0; font-size:12.5px; }
  .funnel .fr.worst .fl{ color:var(--red); font-weight:700; }
  .funnel .fb{ height:16px; background:#f0f3f9; border-radius:5px; overflow:hidden; } .funnel .fb i{ display:block; height:100%; border-radius:5px; }
  .funnel .fb i.A, .lg.A{ background:#7aa7ef; } .funnel .fb i.B, .lg.B{ background:var(--blue); }
  .funnel .fn{ text-align:right; font-weight:700; } .funnel .fd{ font-size:12px; text-align:right; }
  .lg{ display:inline-block; width:10px; height:10px; border-radius:3px; vertical-align:-1px; margin-right:4px; }
  .kvrow{ display:grid; grid-template-columns:1fr 40px 100px; gap:8px; padding:6px 0; border-bottom:1px solid #f1f4f9; font-size:13px; } .kvrow b{ text-align:right; } .kvrow span:last-child{ text-align:right; font-size:12px; }
  .mini{ display:grid; grid-template-columns:repeat(10,1fr); gap:2px; margin-bottom:3px; } .mini i{ height:6px; border-radius:3px; background:#e3e8f1; } .mini i.d{ background:#2f9e44; } .mini i.x{ background:#e8590c; }
  .mini.big i{ height:9px; }
  .tl > div{ display:flex; gap:8px; padding:5px 0; font-size:12.8px; border-bottom:1px dashed #edf0f6; line-height:1.35; }
  .wathread{ background:#ece5dd; border-radius:10px; padding:8px; max-height:420px; overflow:auto; display:flex; flex-direction:column; gap:5px; }
  .wathread .wa{ background:#fff; border-radius:8px; padding:6px 8px; font-size:12.5px; white-space:pre-wrap; max-width:92%; } .wathread .wa.in{ background:#d9fdd3; align-self:flex-end; }
  .tl{ max-height:420px; overflow:auto; }

  /* ---- Flow page: boxes and arrows, live values ---- */
  .frow{ display:flex; align-items:stretch; gap:6px; flex-wrap:wrap; }
  .fgrid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-top:14px; }
  .fcol{ display:flex; flex-direction:column; }
  .fcol h4{ margin:0 0 6px; font-size:11.5px; letter-spacing:.6px; text-transform:uppercase; color:var(--muted); }
  .fn{ flex:1; min-width:150px; background:#fff; border:1.5px solid #b9c9e6; border-radius:10px; padding:8px 10px; font-size:12.5px; line-height:1.4; }
  .fn > b{ display:block; font-size:13px; color:var(--ink); }
  .fn > span{ display:block; color:var(--muted); }
  .fn > em{ display:inline-block; margin-top:5px; font-style:normal; font-size:11.5px; background:var(--tint); color:var(--blue); border-radius:10px; padding:1px 8px; }
  .fn.b{ background:#e3eeff; border-color:#7fb3ff; } .fn.q{ background:#fff8e1; border-color:#e0b84a; } .fn.ok{ background:var(--ok-t); border-color:#7cc49a; }
  .fn.r{ background:var(--red-t); border-color:#e39a92; } .fn.v{ background:var(--violet-t); border-color:#b6a3ee; } .fn.off{ opacity:.55; border-style:dashed; }
  .fa{ align-self:center; color:#7f96c2; font-style:normal; font-weight:700; font-size:15px; }
  .fa.d{ display:block; text-align:center; line-height:20px; }
  .lv{ color:var(--blue); background:var(--tint); border-radius:5px; padding:0 4px; font-weight:700; white-space:nowrap; }
  .fsteps{ display:flex; gap:4px; flex-wrap:wrap; margin:6px 0 4px; }
  .fstep{ flex:1; min-width:96px; border-radius:8px; padding:6px 8px; font-size:12px; background:#e8eefb; }
  .fstep.B{ background:var(--violet-t); } .fstep i{ font-style:normal; font-weight:700; margin-right:3px; }
  .ftl{ list-style:none; padding:0; margin:0; }
  .ftl li{ display:grid; grid-template-columns:118px 1fr; gap:10px; padding:8px 0; border-top:1px solid #f0f2f7; font-size:13px; line-height:1.45; }
  .ftl li:first-child{ border-top:0; } .ftl li > b:first-child{ color:var(--blue); }
  .ftl code, .wab code{ font-size:11.5px; background:#f1f4fa; border-radius:4px; padding:0 4px; }
  .wabs{ display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:12px; }
  .wabox{ background:#efeae2; border-radius:10px; padding:10px; }
  .wabox .wh{ display:flex; align-items:center; gap:6px; margin-bottom:6px; font-size:12px; }
  .wab{ background:#fff; border-radius:8px; padding:7px 9px; font-size:12.5px; line-height:1.4; white-space:pre-wrap; box-shadow:0 1px 1px rgba(0,0,0,.08); }
  .wab .var{ background:#fff3c4; border-radius:4px; padding:0 2px; }
  .wabtn{ margin-top:4px; background:#fff; border-radius:8px; padding:5px; text-align:center; color:#027eb5; font-size:12.5px; box-shadow:0 1px 1px rgba(0,0,0,.08); }
  @media (max-width:1100px){ .fgrid{ grid-template-columns:1fr 1fr; } }
  @media (max-width:700px){ .fgrid{ grid-template-columns:1fr; } .ftl li{ grid-template-columns:1fr; gap:2px; } }
