/* =====================================================================
 * Migration: your history moved across and proved to match
 * (template-parts/stages/migrate.php). Loaded on /odoo-migration/ only.
 *
 * Two windows turned toward each other like an open book: the old system,
 * grey and dated, on the left; Odoo, bright, on the right. Records arc across
 * in front of them (offset-path for the arc, transform for depth and turn).
 * Four sources are scenes; the old window's look is one screen per source.
 * ===================================================================== */
.stage-migrate .stage-3d{width:660px;height:520px}
.stage-migrate .sp>div{transform-style:preserve-3d}
.stage-migrate .sp.mg-still>div{animation:none}

/* One source at a time. No script shows the first. */
.stage-migrate .stage-3d:not([data-on="qb"]) [data-in="qb"],
.stage-migrate .stage-3d:not([data-on="tl"]) [data-in="tl"],
.stage-migrate .stage-3d:not([data-on="od"]) [data-in="od"],
.stage-migrate .stage-3d[data-on]:not([data-on="xl"]) [data-in="xl"]{display:none}

/* ---------- Floor ---------- */
.mg-floor{position:absolute;left:-40px;top:234px;width:740px;height:380px;border-radius:50%;pointer-events:none;transform:translateZ(-70px) rotateX(76deg);
  background:radial-gradient(closest-side,rgba(47,125,246,.3),rgba(47,125,246,.08) 55%,transparent 75%)}
.mg-floor i{position:absolute;left:24%;right:24%;top:46%;height:16px;border-radius:50%;background:radial-gradient(closest-side,rgba(150,200,255,.75),rgba(90,160,255,.2) 60%,transparent);
  animation:mg-bridge 3.2s ease-in-out infinite}
@keyframes mg-bridge{50%{opacity:.45}}

/* ---------- Source picker ---------- */
.mg-pick{display:flex;flex-wrap:wrap;align-items:center;gap:6px 5px;width:300px;padding:9px 10px 10px;border-radius:16px;pointer-events:auto;
  background:rgba(12,18,31,.88);border:1px solid rgba(140,180,255,.2);box-shadow:0 20px 40px -24px rgba(0,0,0,.9)}
.mg-pick small{flex-basis:100%;margin:0 0 1px 4px;font:500 9.5px/1 var(--f-mono);letter-spacing:.1em;text-transform:uppercase;color:rgba(234,241,255,.5);white-space:nowrap}
.mg-pick button{font:500 11.5px/1 var(--f-body);color:rgba(234,241,255,.75);background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08);border-radius:99px;padding:7px 8px;cursor:pointer;white-space:nowrap;transition:color .25s,background .25s,border-color .25s}
.mg-pick button:hover{color:#fff;border-color:rgba(140,180,255,.35)}
.mg-pick button.cur,.mg-pick:not(:has(.cur)) button:first-of-type{color:#fff;background:rgba(47,125,246,.3);border-color:rgba(110,170,255,.65)}

/* ---------- Windows, turned toward each other ---------- */
.mg-old-sp>div{transform:rotateY(24deg)}
.mg-new-sp>div{transform:rotateY(-22deg)}
.mg-edge{position:absolute;left:0;top:8px;bottom:8px;width:16px;transform-origin:0 50%;transform:rotateY(90deg);background:linear-gradient(180deg,#5A606A,#2A2E35)}
.mg-new-sp .mg-edge{left:auto;right:0;transform-origin:100% 50%;transform:rotateY(-90deg);background:linear-gradient(180deg,#2A3C60,#0E1626)}

/* The old system: grey, bevelled, small type */
.mg-old{position:relative;width:256px;height:276px;display:flex;flex-direction:column;overflow:hidden;border-radius:3px;color:#C7CCD4;font:9.5px/1.3 Tahoma,Verdana,"Segoe UI",sans-serif;
  background:#3A3F47;border:2px solid;border-color:#8E949E #22252B #22252B #8E949E;box-shadow:0 50px 80px -40px rgba(0,0,0,.92);filter:saturate(.7)}
.mg-ob{flex:none;display:flex;align-items:center;gap:6px;height:24px;padding:0 4px 0 7px;color:#F1F3F6;font-weight:700;font-size:10px;background:linear-gradient(90deg,#4A515C,#79808B)}
.mg-ob>i{flex:none;width:11px;height:11px;border-radius:2px;background:#9AA1AB;box-shadow:inset -1px -1px 0 #4A505A,inset 1px 1px 0 #C9CED6}
.mg-ob>span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mg-ob em{flex:none;width:15px;height:13px;display:grid;place-items:center;font:700 9px/1 Tahoma,sans-serif;font-style:normal;color:#22252B;background:#B4B9C1;box-shadow:inset -1px -1px 0 #5D636C,inset 1px 1px 0 #E6E8EC}
.stage-3d[data-on="tl"] .mg-ob{background:linear-gradient(90deg,#1D4C55,#3D7480)}
.stage-3d[data-on="od"] .mg-ob{background:linear-gradient(90deg,#5A4A5E,#7E6D80)}
.stage-3d[data-on="qb"] .mg-ob{background:linear-gradient(90deg,#4C5A4E,#748676)}
.mg-scr{flex:1;min-height:0;display:flex;flex-direction:column}
.mg-os{flex:none;height:20px;display:flex;align-items:center;padding:0 7px;border-top:1px solid #23262C;box-shadow:inset 0 1px 0 #555B64;font-size:9px;color:#AEB4BD;white-space:nowrap;overflow:hidden}

/* Excel */
.mg-tool{display:flex;align-items:center;gap:5px;height:24px;padding:0 6px;background:#4A4F57;border-bottom:1px solid #2A2D33}
.mg-tool i{width:12px;height:12px;border-radius:2px;background:#6E747E}
.mg-tool b{width:13px;text-align:center;font:700 10px Tahoma,sans-serif;color:#D5D9DF}
.mg-tool span{font:italic 700 9.5px Tahoma,sans-serif;color:#9AA1AB}
.mg-tool .mg-fx{flex:1;font:9.5px "Courier New",monospace;font-style:normal;color:#D9DDE3;background:#2F333A;padding:2px 5px;border:1px solid #23262C}
.mg-grid{display:grid;grid-template-columns:20px 1fr 1fr 1.1fr;margin:0;background:#2E3238}
.mg-grid span{height:21px;display:flex;align-items:center;padding:0 5px;border-right:1px solid #50565F;border-bottom:1px solid #50565F;white-space:nowrap;overflow:hidden;color:#D3D7DD;background:#383C43}
.mg-grid .h{justify-content:center;padding:0;color:#9AA1AB;background:#4B5059;font-size:9px}
.mg-grid .t{font-weight:700;color:#E6E9ED;background:#41464E}
.mg-grid .r{justify-content:flex-end;font-family:"Courier New",monospace}
.mg-tabs{margin-top:auto;display:flex;gap:2px;padding:3px 6px 0;background:#30343A}
.mg-tabs span{padding:3px 8px;font-size:9px;color:#9AA1AB;background:#41464E;border:1px solid #23262C;border-bottom:0}
.mg-tabs .on{color:#E6E9ED;background:#575D66}

/* QuickBooks-era desktop list */
.mg-qh{display:flex;justify-content:space-between;align-items:baseline;padding:8px 8px 6px;background:#4A525C;border-bottom:1px solid #2A2D33}
.mg-qh b{font-size:11px;color:#EEF0F3}
.mg-qh span{font-size:9px;color:#AEB4BD}
.mg-ql p{display:flex;justify-content:space-between;padding:6px 8px;margin:0;border-bottom:1px solid #4A4F57;color:#D3D7DD}
.mg-ql p:nth-child(odd){background:#41464E}
.mg-ql b{font:9.5px "Courier New",monospace;font-weight:700;color:#E6E9ED}

/* Tally: a text screen */
.mg-tl{padding:8px 10px;background:#0F3A42;font:10px/1.35 "Courier New",monospace;color:#E9F2D0}
.mg-tl p{display:flex;justify-content:space-between;margin:0;padding:4px 0;border-bottom:1px dotted rgba(233,242,208,.25)}
.mg-tl b{color:#FFE88A;font-weight:700}
.mg-tl .mg-th{justify-content:center;padding:2px 0 8px;color:#FFE88A;font-weight:700;letter-spacing:.06em;border-bottom:1px solid rgba(233,242,208,.5)}
.mg-tl .mg-tc{margin-top:6px;border-bottom:0;border-top:1px solid rgba(233,242,208,.5)}
.mg-tl .mg-tk{margin-top:auto;justify-content:flex-start;border:0;font-size:9px;color:rgba(233,242,208,.6)}

/* An older Odoo */
.mg-oh{display:flex;align-items:center;gap:6px;padding:8px;background:#45404A;border-bottom:1px solid #2A2D33}
.mg-oh b{flex:1;font-size:11px;color:#EEF0F3}
.mg-oh span{font-size:9px;padding:3px 7px;border-radius:2px;color:#fff;background:#7A6478}
.mg-oh span+span{color:#D3D7DD;background:#575D66}
.mg-ol p{display:grid;grid-template-columns:10px 1.3fr 1fr auto;gap:6px;align-items:center;margin:0;padding:6px 8px;border-bottom:1px solid #4A4F57;color:#D3D7DD}
.mg-ol i{width:9px;height:9px;border:1px solid #8E949E;background:#2E3238}
.mg-ol b{font:9.5px "Courier New",monospace;font-weight:700;color:#E6E9ED}

/* The new Odoo: bright, modern */
.mg-new{position:relative;width:282px;padding-bottom:12px;border-radius:18px;color:#EAF1FF;font:12px/1.3 var(--f-body);
  background:linear-gradient(180deg,rgba(26,38,64,.97),rgba(11,16,28,.98));border:1px solid rgba(140,180,255,.3);
  box-shadow:0 60px 90px -44px rgba(0,0,0,.95),0 0 90px -30px rgba(47,125,246,.65),inset 0 1px 0 rgba(255,255,255,.1)}
.mg-nb{display:flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-bottom:1px solid rgba(255,255,255,.07)}
.mg-nb>i{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.16)}
.mg-nb>i:first-child{background:rgba(255,95,87,.75)}.mg-nb>i:nth-child(2){background:rgba(254,188,46,.7)}.mg-nb>i:nth-child(3){background:rgba(40,200,64,.65)}
.mg-nb b{margin-left:6px;font:600 11.5px var(--f-disp);color:#fff;white-space:nowrap}
.mg-live{margin-left:auto;display:inline-flex;align-items:center;gap:5px;font:500 9px/1 var(--f-mono);letter-spacing:.08em;text-transform:uppercase;color:#6EE7B7;background:rgba(62,213,152,.12);padding:4px 7px;border-radius:99px}
.mg-live::before{content:"";width:5px;height:5px;border-radius:50%;background:#3ED598;animation:blink 1.4s infinite}
.mg-nh{display:flex;justify-content:space-between;align-items:baseline;gap:8px;height:40px;padding:11px 14px 0}
.mg-nh b{font:600 14px var(--f-disp);color:#fff;white-space:nowrap}
.mg-nh small{font:500 10px var(--f-mono);color:#9CC4FF;white-space:nowrap}
.mg-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto 16px;align-items:center;gap:8px;height:44px;margin:0 10px;padding:0 6px 6px;border-top:1px solid rgba(255,255,255,.06)}
.mg-rl{display:flex;align-items:center;gap:8px;font-size:12.5px;color:#EAF1FF;white-space:nowrap}
.mg-ic{flex:none;width:22px;height:22px;border-radius:7px;background:rgba(47,125,246,.22)}
.mg-rc .mg-ic{background:rgba(47,125,246,.3)}
.mg-rp .mg-ic{background:rgba(43,196,180,.3)}
.mg-ri .mg-ic{background:rgba(254,188,46,.3)}
.mg-rb .mg-ic{background:rgba(62,213,152,.3)}
.mg-row>b{font:600 12.5px/1 var(--f-mono);color:#fff;font-variant-numeric:tabular-nums;white-space:nowrap}
.mg-rb>b{font-size:11.5px}
.mg-tk{width:16px;height:16px;border-radius:50%;transition:opacity .3s,transform .4s cubic-bezier(.3,1.6,.5,1);
  background:#1F9D63 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") no-repeat center/9px}
.mg-bar{position:absolute;left:6px;right:6px;bottom:6px;height:3px;border-radius:2px;background:rgba(255,255,255,.08);overflow:hidden}
.mg-bar i{display:block;height:100%;width:100%;border-radius:2px;background:linear-gradient(90deg,#2F7DF6,#3ED598)}
.mg-nf{display:grid;margin:8px 14px 0;font-size:11.5px;line-height:1.35}
.mg-nf>span{grid-area:1/1;transition:opacity .35s}
.mg-f0{color:rgba(234,241,255,.6)}
.mg-f1{color:#6EE7B7}

/* ---------- Records in flight ---------- */
.mg-flights{position:absolute;left:0;top:0;width:660px;height:520px;transform-style:preserve-3d;pointer-events:none}
.mg-fly{position:absolute;left:0;top:0;display:flex;align-items:center;gap:7px;padding:7px 10px 7px 8px;border-radius:10px;opacity:0;white-space:nowrap;offset-rotate:0deg;offset-anchor:50% 50%;
  color:#fff;background:linear-gradient(160deg,#2A4475,#142441);border:1px solid rgba(160,200,255,.6);box-shadow:0 0 22px rgba(90,160,255,.5),0 14px 24px -12px rgba(0,0,0,.9);font-style:normal}
.mg-fly::before{content:"";flex:none;width:9px;height:9px;border-radius:3px;background:var(--k)}
.mg-fly b{font:600 10.5px/1 var(--f-body)}
.mg-fly span{font:500 10px/1 var(--f-mono);color:rgba(234,241,255,.7)}
.mg-fly-c{--k:#5AA0FF;offset-path:path("M196 204 Q330 58 472 176")}
.mg-fly-p{--k:#2BC4B4;offset-path:path("M196 242 Q330 90 472 220")}
.mg-fly-i{--k:#FEBC2E;offset-path:path("M196 280 Q330 122 472 264")}
.mg-fly-b{--k:#3ED598;offset-path:path("M196 318 Q330 154 472 308")}
.mg-fly.on{animation:mg-go 1.1s cubic-bezier(.45,.05,.3,1) forwards,mg-arc 1.1s linear forwards}
@keyframes mg-go{from{offset-distance:0%}to{offset-distance:100%}}
@keyframes mg-arc{
  0%{opacity:0;transform:translateZ(-18px) rotateY(24deg);animation-timing-function:cubic-bezier(.3,.7,.6,1)}
  12%{opacity:1}
  50%{transform:translateZ(170px) rotateY(0deg);animation-timing-function:cubic-bezier(.4,0,.7,.3)}
  84%{opacity:1}
  100%{opacity:0;transform:translateZ(-8px) rotateY(-22deg)}
}

/* ---------- The proof ---------- */
.mg-proof{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:5px 12px;width:430px;padding:11px 14px;border-radius:15px;
  background:linear-gradient(160deg,rgba(22,52,46,.95),rgba(9,21,22,.96));border:1px solid rgba(62,213,152,.42);
  box-shadow:0 34px 56px -28px rgba(0,0,0,.92),0 0 44px -18px rgba(62,213,152,.6);transition:opacity .45s,transform .6s cubic-bezier(.2,.7,.2,1)}
.mg-ok{grid-row:1 / span 2;width:28px;height:28px;border-radius:50%;
  background:#1F9D63 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") no-repeat center/15px;box-shadow:0 0 16px rgba(62,213,152,.6)}
.mg-pt{display:flex;align-items:baseline;gap:9px;min-width:0;white-space:nowrap}
.mg-pt small{font-size:11.5px;color:rgba(234,241,255,.72)}
.mg-pt b{font:700 17px/1 var(--f-disp);letter-spacing:-.02em;color:#fff;font-variant-numeric:tabular-nums}
.mg-fils{grid-column:3;grid-row:1;font:600 10px/1 var(--f-body);white-space:nowrap;padding:6px 9px;border-radius:99px;color:#0B2A1E;background:#6EE7B7}
.mg-pv{grid-column:2 / -1;grid-row:2;font:500 9.5px/1.3 var(--f-mono);color:rgba(234,241,255,.6);white-space:nowrap}

/* ---------- Script running: the Odoo side starts empty ---------- */
.mg-num{transition:opacity .3s}
.js .mg-num:not(.on){opacity:0}
.js .mg-row:not(.ok) .mg-tk{opacity:0;transform:scale(.4)}
.js .mg-row:not(.in) .mg-bar i{width:0}
.mg-rc.in .mg-bar i{transition:width 1.3s linear}
.mg-rp.in .mg-bar i,.mg-ri.in .mg-bar i{transition:width 1.2s linear}
.mg-rb.in .mg-bar i{transition:width 1.1s linear}
.mg-row.in:not(.ok){background:linear-gradient(90deg,rgba(47,125,246,.12),transparent);border-radius:8px}
html:not(.js) .mg-f0,.mg-nf:has(.mg-f1.on) .mg-f0{opacity:0}
.js .mg-f1:not(.on){opacity:0}
.js .mg-proof:not(.on){opacity:0;transform:translateY(16px)}

/* ---------- Phones ---------- */
@media (max-width:899px){
  .stage-migrate .stage-3d{scale:.56}
}
@media (max-width:420px){
  .stage-migrate .stage-3d{scale:.5}
}
@media (prefers-reduced-motion:reduce){
  .mg-fly{display:none}
  .mg-floor i,.mg-live::before{animation:none}
}
