/* AMPLIS Campaigns — flow visualizer
   Brand: navy #002147, gold #C9A227. System fonts (no external deps). */

:root{
  --navy:#002147; --gold:#C9A227; --gold-soft:#D9B368;
  --blue:#3E6EA5; --green:#3F9D7C;
  --ink:#1c2430; --muted:#8a93a0; --line:#e7e9ee; --link:#2f5fa0;
  --bg:#f4f5f7; --card:#ffffff; --conn:#c9a227; --chip:#eef1f6;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--ink);
  font-family:"Segoe UI",system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif;}

.camp-app{display:flex;flex-direction:column;height:100vh;}

/* ---- top bar ---- */
.camp-topbar{display:flex;align-items:center;justify-content:space-between;
  background:var(--navy);color:#fff;padding:0 20px;height:56px;flex:0 0 auto;}
.camp-brand{display:flex;align-items:center;gap:8px;font-weight:700;letter-spacing:.5px;}
.camp-brand-mark{color:var(--gold);}
.camp-brand-word{font-weight:800;}
.camp-brand-sep{opacity:.5;margin:0 2px;}
.camp-brand-app{font-weight:500;opacity:.9;}
.camp-topbar-right{display:flex;align-items:center;gap:10px;}
.camp-whoami{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.18);border-radius:20px;padding:6px 12px;cursor:pointer;font-size:13px;}
.camp-whoami:hover{background:rgba(255,255,255,.18);}
.camp-whoami-dot{width:9px;height:9px;border-radius:50%;background:var(--gold);}
.camp-caret{opacity:.7;font-size:11px;}

/* ---- body layout ---- */
.camp-body{display:flex;flex:1 1 auto;min-height:0;}
.camp-sidebar{flex:0 0 244px;background:#fff;border-right:1px solid var(--line);
  display:flex;flex-direction:column;overflow-y:auto;}
.camp-sidebar-head{display:flex;align-items:center;justify-content:space-between;
  padding:16px 18px 10px;font-size:12px;font-weight:800;letter-spacing:.08em;
  text-transform:uppercase;color:var(--muted);}
.camp-icon-btn{border:1px solid var(--line);background:#fff;border-radius:7px;width:26px;height:26px;
  cursor:pointer;color:var(--navy);font-size:15px;line-height:1;}
.camp-icon-btn:hover{background:var(--chip);}
.camp-client-list{padding:4px 10px 20px;}
.camp-client{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:9px;
  cursor:pointer;font-size:14px;font-weight:600;color:#2b3542;}
.camp-client:hover{background:var(--chip);}
.camp-client.is-active{background:var(--navy);color:#fff;}
.camp-client .dot{width:9px;height:9px;border-radius:2px;background:var(--gold);flex:0 0 auto;}
.camp-client.is-active .dot{background:var(--gold-soft);}
.camp-client .count{margin-left:auto;font-size:11px;opacity:.6;}

.camp-main{flex:1 1 auto;overflow:auto;}
.camp-flow-root{width:max-content;min-width:100%;padding:30px 34px 60px;}

/* ---- flow header ---- */
.flow-head{display:flex;align-items:baseline;gap:12px;margin:0 0 4px;}
.flow-head h1{font-size:15px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin:0;font-weight:800;}
.flow-empty{color:var(--muted);font-size:15px;padding:60px 20px;text-align:center;}

/* ---- pure-CSS flow tree (horizontal, left-to-right) ---- */
.tree ul{list-style:none;margin:0 0 0 20px;padding-left:36px;display:flex;flex-direction:column;justify-content:center;position:relative;}
.tree>ul{margin-left:0;padding-left:0;}
.tree li{position:relative;display:flex;align-items:center;padding:11px 0;list-style:none;}
.tree li::before{content:'';position:absolute;left:-36px;top:0;bottom:0;border-left:3px solid var(--conn);}
.tree li:first-child::before{top:50%;border-radius:6px 0 0 0;}
.tree li:last-child::before{bottom:50%;}
.tree li:only-child::before{display:none;}
.tree li::after{content:'';position:absolute;left:-36px;top:50%;width:36px;border-top:3px solid var(--conn);}
.tree ul::before{content:'';position:absolute;top:50%;left:-20px;width:20px;border-top:3px solid var(--conn);}
.tree>ul::before{display:none;}
.tree>ul>li::before,.tree>ul>li::after{display:none;}
.onlyline{display:none;}

/* ---- nodes ---- */
.client-node{background:var(--navy);color:#fff;font-weight:800;font-size:24px;padding:12px 34px;border-radius:13px;
  box-shadow:0 6px 16px rgba(0,33,71,.25);}
.ptype{color:#fff;font-weight:800;font-size:17px;padding:10px 22px;border-radius:11px;
  box-shadow:0 4px 12px rgba(0,0,0,.15);display:flex;align-items:center;gap:8px;}
.ptype.paid_ads{background:var(--gold)} .ptype.linkedin{background:var(--blue)} .ptype.email{background:var(--green)}
.ptype small{font-weight:600;opacity:.85;font-size:11px}

.node{background:var(--card);border-radius:12px;box-shadow:0 2px 8px rgba(20,30,50,.12);padding:13px 14px;text-align:left;}
.node.audience{width:250px;border-top:4px solid var(--gold);}
.node.angle{width:230px;border-top:4px solid var(--navy);}
.node.copyads{width:360px;}
.node.seq{width:360px;border-top:4px solid var(--navy);}

.nlabel{font-size:10.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);}
.ntitle{font-size:15.5px;font-weight:800;margin:2px 0 2px;line-height:1.2;}
.subtag{display:inline-block;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  color:#6b7686;background:var(--chip);border-radius:20px;padding:1px 9px;margin-bottom:6px;}
.ntext{font-size:13px;line-height:1.4;color:#33404f;}
a.link{color:var(--link);text-decoration:underline;font-weight:600;}
.stamp{display:block;margin-top:4px;font-size:10.5px;color:var(--muted);font-style:italic;}

.head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:4px;}
.status{font-size:10.5px;font-weight:800;border-radius:20px;padding:2px 9px 2px 8px;display:inline-flex;
  align-items:center;gap:5px;white-space:nowrap;}
.status .dot{width:7px;height:7px;border-radius:50%;}
.live{background:#e6f4ee;color:#1f7a54;} .live .dot{background:#2ba76a;}
.paused{background:#fbeecb;color:#8a6a12;} .paused .dot{background:#e0a92b;}

.sub{margin-top:10px;padding-top:9px;border-top:1px solid var(--line);}
.sub.first{margin-top:0;padding-top:0;border-top:none;}
.blabel{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:800;letter-spacing:.05em;
  text-transform:uppercase;color:var(--navy);margin-bottom:6px;}
.count{font-size:9.5px;background:var(--navy);color:#fff;border-radius:20px;padding:1px 7px;letter-spacing:0;}
.item{border-left:3px solid var(--gold);padding-left:8px;margin-bottom:7px;}
.item:last-child{margin-bottom:0;}
.iname{font-size:11px;font-weight:700;color:#33404f;}
.ival{font-size:12.5px;line-height:1.35;color:#33404f;}
.thumbs{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-top:2px;}
.thumbs .t{padding-top:100%;border-radius:4px;}
.t1{background:linear-gradient(135deg,#d7d2c8,#b7ae9e)} .t2{background:linear-gradient(135deg,#c9d3dd,#8fa2b3)}
.t3{background:linear-gradient(135deg,#6b7a63,#43503c)} .t4{background:linear-gradient(135deg,#4a5b6b,#2c3743)}
.msg{font-size:12.5px;margin-bottom:5px;} .msg b{color:var(--navy);}
.msg-item{margin-bottom:16px;} .msg-item:last-child{margin-bottom:0;}
.msg-item .iname{color:var(--navy);font-size:12px;letter-spacing:.02em;margin-bottom:1px;}

/* ---- inline click-to-edit ---- */
.editable{cursor:text;border-radius:5px;padding:1px 4px;margin:0 -4px;
  transition:background .12s ease,box-shadow .12s ease;}
.editable:hover{background:#fff7e0;box-shadow:inset 0 0 0 1px #ecdca5;}
.editable.is-empty::before{content:attr(data-ph);color:#aeb6c0;font-style:italic;}
.editable.editing{background:#fff;box-shadow:none;padding:0;margin:0;}
.inline-edit{font:inherit;color:inherit;line-height:1.4;width:100%;box-sizing:border-box;
  border:1px solid var(--gold);border-radius:6px;padding:5px 7px;outline:none;background:#fff;
  resize:none;box-shadow:0 0 0 3px rgba(201,162,39,.15);}
.node.saved-flash{animation:savedflash 1.1s ease;}
@keyframes savedflash{0%{box-shadow:0 0 0 2px #2ba76a, 0 2px 8px rgba(20,30,50,.12);}
  100%{box-shadow:0 2px 8px rgba(20,30,50,.12);}}
.status.toggle{cursor:pointer;}
.status.toggle:hover{box-shadow:0 0 0 2px rgba(0,0,0,.08);}

/* ---- add / delete affordances ---- */
.node{position:relative;}
.head-right{display:flex;align-items:center;gap:6px;}
.dots{border:none;background:transparent;color:#aab2bd;cursor:pointer;font-size:17px;line-height:1;
  padding:0 5px;border-radius:5px;opacity:0;transition:opacity .12s,background .12s,color .12s;}
.node:hover .dots{opacity:1;}
.dots:hover{background:rgba(0,0,0,.06);color:#5b6b7b;}
.node.audience > .dots{position:absolute;top:8px;right:8px;}
.ptype .dots{color:rgba(255,255,255,.85);opacity:.55;margin-left:4px;font-size:16px;}
.ptype:hover .dots{opacity:1;}
.ptype .dots:hover{background:rgba(255,255,255,.18);color:#fff;}
.item-head{display:flex;justify-content:space-between;align-items:flex-start;gap:6px;}
.item-head .iname{flex:1;}
.item .dots{opacity:0;font-size:15px;padding:0 3px;}
.item:hover .dots{opacity:.8;}
.thumbs .t{position:relative;}
.ad-x{position:absolute;top:2px;right:2px;width:17px;height:17px;border:none;border-radius:4px;
  background:rgba(0,0,0,.55);color:#fff;font-size:13px;line-height:1;cursor:pointer;opacity:0;
  display:flex;align-items:center;justify-content:center;transition:opacity .12s;}
.thumbs .t:hover .ad-x{opacity:1;}
.ad-x:hover{background:#c0503f;}

.add-btn{border:1px dashed #cdd3dc;background:#fff;color:#8a93a0;border-radius:7px;padding:6px 10px;
  font-size:12px;font-weight:600;cursor:pointer;width:100%;margin-top:8px;transition:all .12s;}
.add-btn:hover{border-color:var(--gold);color:var(--navy);background:#fffdf5;}
.node-add{width:auto;margin-top:0;white-space:nowrap;box-shadow:0 1px 3px rgba(20,30,50,.06);}
.add-li{padding:8px 0;}

/* ---- menus + confirm dialog ---- */
.camp-menu-item.danger{color:#c0503f;font-weight:600;}
.camp-menu-item.danger:hover{background:#fdece9;}
.camp-overlay{position:fixed;inset:0;background:rgba(10,20,40,.35);display:flex;
  align-items:center;justify-content:center;z-index:200;}
.camp-dialog{background:#fff;border-radius:14px;padding:22px 22px 18px;max-width:390px;
  box-shadow:0 20px 50px rgba(10,20,40,.3);}
.camp-dialog h4{margin:0 0 8px;font-size:17px;color:var(--navy);}
.camp-dialog p{margin:0 0 18px;font-size:13.5px;color:#5b6b7b;line-height:1.5;}
.camp-dialog-actions{display:flex;justify-content:flex-end;gap:10px;}
.btn-ghost{border:1px solid var(--line);background:#fff;color:#33404f;border-radius:8px;
  padding:8px 16px;font-weight:600;cursor:pointer;}
.btn-ghost:hover{background:var(--chip);}
.btn-danger{border:none;background:#c0503f;color:#fff;border-radius:8px;padding:8px 16px;font-weight:700;cursor:pointer;}
.btn-danger:hover{background:#a8412f;}

/* ---- audience list link ---- */
.audience-list{font-size:12.5px;margin-top:7px;color:#5b6b7b;display:flex;align-items:baseline;gap:5px;flex-wrap:wrap;}
.list-label{font-weight:700;color:var(--navy);}
.list-edit{color:var(--link);word-break:break-all;}
.open-link{font-weight:600;white-space:nowrap;}

/* ---- drag to reorder ---- */
.grip{color:#c2c9d2;cursor:grab;font-size:13px;line-height:1;user-select:none;
  opacity:0;transition:opacity .12s;margin-right:2px;}
.item:hover .grip{opacity:1;}
[data-reorder]{transition:box-shadow .12s,opacity .12s;}
.item[data-reorder]:hover{box-shadow:inset 3px 0 0 var(--gold);}
.dragging{opacity:.45;box-shadow:0 0 0 2px var(--gold);}
.thumbs .t[draggable]{cursor:grab;}

/* ---- archived button + restore drawer ---- */
.flow-head{display:flex;align-items:center;gap:14px;}
.archived-btn{border:1px solid var(--line);background:#fff;color:#5b6b7b;border-radius:20px;
  padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer;transition:all .12s;}
.archived-btn:hover{border-color:var(--gold);color:var(--navy);}
.arch-count{background:var(--navy);color:#fff;border-radius:20px;padding:0 6px;font-size:10.5px;margin-left:3px;}
.camp-drawer{background:#fff;border-radius:14px;width:440px;max-width:92vw;max-height:80vh;overflow:auto;
  box-shadow:0 20px 50px rgba(10,20,40,.3);}
.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px 12px;
  position:sticky;top:0;background:#fff;border-bottom:1px solid var(--line);}
.drawer-head h4{margin:0;font-size:17px;color:var(--navy);}
.drawer-close{border:none;background:transparent;font-size:16px;color:var(--muted);cursor:pointer;}
.drawer-list{padding:8px 14px 16px;}
.drawer-empty{color:var(--muted);font-size:13.5px;padding:24px 8px;text-align:center;}
.drawer-row{display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:11px 8px;border-bottom:1px solid var(--line);}
.drawer-row:last-child{border-bottom:none;}
.drawer-info{display:flex;flex-direction:column;gap:1px;min-width:0;}
.drawer-sub{font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);}
.drawer-label{font-size:13.5px;color:#33404f;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:300px;}
.btn-restore{border:1px solid var(--gold);background:#fffdf5;color:var(--navy);border-radius:7px;
  padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;white-space:nowrap;}
.btn-restore:hover{background:var(--gold);color:#fff;}

/* ---- Meta auto-sync ---- */
.blabel .hint{font-weight:600;letter-spacing:0;text-transform:none;color:var(--muted);font-size:10px;}
.synced-badge{margin-left:auto;font-size:9.5px;font-weight:800;letter-spacing:.03em;
  color:#2f6f52;background:#e6f4ee;border-radius:20px;padding:2px 7px;}
.blabel{position:relative;}
.thumbs .t img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:4px;}
.ads-empty{font-size:12px;color:var(--muted);font-style:italic;padding:6px 2px;}
.connect-meta{border-style:dashed;border-color:#b9c6d6;color:#3e6ea5;background:#f6f9fd;}
.connect-meta:hover{border-color:#3e6ea5;background:#eef4fb;color:#274d78;}
.syncbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px;
  font-size:10.5px;color:var(--muted);}
.sync-info{font-style:italic;}
.sync-now{border:1px solid var(--line);background:#fff;color:var(--navy);border-radius:6px;
  padding:3px 10px;font-size:11px;font-weight:700;cursor:pointer;}
.sync-now:hover{border-color:var(--gold);background:#fffdf5;}

/* ---- who-am-I menu ---- */
.camp-menu{position:absolute;background:#fff;border:1px solid var(--line);border-radius:12px;
  box-shadow:0 12px 30px rgba(10,20,40,.18);padding:8px;min-width:210px;z-index:50;}
.camp-menu-item{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:8px;cursor:pointer;font-size:14px;}
.camp-menu-item:hover{background:var(--chip);}
.camp-menu-avatar{width:22px;height:22px;border-radius:50%;color:#fff;font-size:10px;font-weight:700;
  display:flex;align-items:center;justify-content:center;}
.camp-menu-row{display:flex;gap:6px;padding:6px;}
.camp-menu-row input{flex:1;border:1px solid var(--line);border-radius:7px;padding:7px 9px;font-size:13px;}
.camp-menu-row button{border:none;background:var(--navy);color:#fff;border-radius:7px;padding:0 14px;font-weight:700;cursor:pointer;}

/* ---- toast ---- */
.camp-toast-root{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:100;display:flex;flex-direction:column;gap:8px;}
.camp-toast{background:var(--navy);color:#fff;padding:10px 16px;border-radius:9px;font-size:13px;box-shadow:0 6px 18px rgba(0,0,0,.2);}
