/* EE migration portal in the CPO One System look ("Stage colours"):
   white top bar with the UBT logo on the right, left-hand menu, Bricolage Grotesque headings with DM Sans text,
   rounded white panels on a pale lilac ground, and one colour per migration stage. Light theme only. */

@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap; src: url('/fonts/dm-sans-latin-wght-normal.woff2') format('woff2-variations'); }

:root {
  color-scheme: light;
  --bg: #f6f5fb;
  --surface: #ffffff;
  --ink: #221c35;
  --ink-2: #3b3550;
  --muted: #6e6787;
  --soft: #f1eefa;
  --soft-ink: #4a4360;
  --hover: #eeebf6;
  --line: #e7e4f0;
  --line-2: #f1eff6;
  --field: #8a83a3;
  --focus: #5b2fd6;
  --red: #b42318;
  --red-bg: #ffe5e5;
  --green: #1e6b3e;
  --green-bg: #e3f2e8;
  --amber: #7a4a00;
  --amber-bg: #fbefd9;

  /* One colour per stage. Bars use the strong colour; chips use the tint with the dark ink. */
  --s-todo: #7c4dff;      --s-todo-bg: #efe9ff;      --s-todo-ink: #5b2fd6;
  --s-confirmed: #2f80ed; --s-confirmed-bg: #e6f0fd; --s-confirmed-ink: #1c5fbf;
  --s-ship: #00a3a3;      --s-ship-bg: #ddf4f4;      --s-ship-ink: #007474;
  --s-delivered: #c8701a; --s-delivered-bg: #fdeedf; --s-delivered-ink: #a85a12;
  --s-live: #1f9a52;      --s-live-bg: #e2f5ea;      --s-live-ink: #1b7a43;
  --s-query: #d6457f;     --s-query-bg: #fce6ef;     --s-query-ink: #b3285f;

  --display: 'Bricolage Grotesque', 'DM Sans', Arial, sans-serif;
  --text: 'DM Sans', Arial, Helvetica, sans-serif;
  --r-sm: 12px;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgba(34, 28, 53, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--text); }
a { color: var(--ink); text-underline-offset: 2px; }
a:hover { color: var(--focus); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin-top: 1.4em; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.crumb { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Top bar (UBT logo stays top right) ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 12px 28px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.tag { font-size: 12px; font-weight: 600; background: var(--soft); color: var(--soft-ink); border-radius: 20px; padding: 3px 10px; white-space: nowrap; }
.tag.live { background: var(--green-bg); color: var(--green); }
.topsearch { flex: 1 1 240px; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: var(--r); padding: 7px 14px; color: var(--muted); }
.topsearch input[type=search] { border: 0; background: transparent; font: inherit; color: var(--ink); width: 100%; max-width: none; padding: 0; outline: none; }
.topsearch:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; font-weight: 500; }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--ink); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; white-space: nowrap; }
.logo { height: 28px; width: auto; display: block; }

/* ---------- Shell: left menu + main ---------- */
.shell { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 24px; padding: 24px 28px 48px 20px; max-width: 1480px; margin: 0 auto; }
.side { flex: 1 1 230px; max-width: 270px; position: sticky; top: 16px; }
.shell > main { flex: 999 1 560px; min-width: 0; }
/* Pages without a left menu (log in, invite, help) */
.page > main { max-width: 920px; margin: 32px auto 48px; padding: 0 16px; }
.page > main.narrow { max-width: 560px; margin-top: 48px; }
.navgroup { font-size: 12px; font-weight: 600; color: var(--muted); margin: 18px 14px 4px; }
.navgroup:first-child { margin-top: 0; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.nav:hover { background: var(--hover); color: var(--ink); }
.nav.on, .nav.on:hover { background: var(--ink); color: #fff; }
.nav svg { flex: none; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.nav.on .count { color: #c9c2e0; }
.nav .count.alert { background: var(--red-bg); color: var(--red); border-radius: 20px; padding: 0 8px; }
.nav .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.nav .tick { margin-left: auto; color: var(--s-live-ink); font-weight: 800; }
.nav.on .tick { color: #b9f0cf; }
.side .acct { padding: 0 14px 6px; }
.side .acct b { display: block; font-family: var(--display); font-size: 16px; line-height: 1.25; }
.side .acct span { font-size: 13px; color: var(--muted); }
.side .cta { margin: 20px 4px 0; }

/* ---------- Panels ---------- */
.card, .panel { background: var(--surface); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.panel { padding: 0; overflow: hidden; }
.ph { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px 22px 12px; border-bottom: 1px solid var(--line-2); }
.ph h2 { margin: 0; font-size: 18px; }
.ph .go { margin-left: auto; font-weight: 700; font-size: 13px; }
.pb { padding: 16px 22px 20px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.head h1 { margin: 0; }
.head p { margin: 4px 0 0; color: var(--muted); }

/* Stat strip */
.stats { display: flex; flex-wrap: wrap; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; }
.stat { flex: 1 1 150px; display: flex; flex-direction: column; gap: 2px; padding: 14px 20px; border-right: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.stat:last-child { border-right: 0; }
a.stat:hover { background: #faf9fd; color: var(--ink); }
.stat b { font-family: var(--display); font-size: 30px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.warn b { color: var(--red); }

/* Stage bar: "Where your numbers are" */
.stagebar { display: flex; gap: 4px; height: 44px; margin-top: 14px; }
.stagebar .seg { border-radius: var(--r-sm); display: flex; align-items: center; padding: 0 12px; color: #fff; font-family: var(--display); font-weight: 700; font-size: 19px; min-width: 6px; text-decoration: none; overflow: hidden; }
.stagebar .seg:hover { color: #fff; filter: brightness(1.06); }
.stagebar.empty { background: var(--soft); border-radius: var(--r-sm); }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 14px; font-size: 13px; font-weight: 600; }
.legend small { display: block; font-weight: 500; font-size: 12px; }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.bg-todo { background: var(--s-todo); } .bg-confirmed { background: var(--s-confirmed); } .bg-ship { background: var(--s-ship); }
.bg-delivered { background: var(--s-delivered); } .bg-live { background: var(--s-live); } .bg-query { background: var(--s-query); }
.bg-off { background: #a7a1bb; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: var(--r); padding: 9px 18px; min-height: 40px; font: 700 14px var(--text); text-decoration: none; cursor: pointer; }
.btn:hover { background: #3a3157; border-color: #3a3157; color: #fff; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: #e2ddee; }
.btn.secondary:hover { background: var(--bg); color: var(--ink); }
.btn.small { padding: 5px 12px; min-height: 32px; font-size: 13px; border-radius: var(--r-sm); }
.btn.danger { background: var(--surface); color: var(--red); border-color: #f3b8b3; }
.btn.danger:hover { background: var(--red-bg); color: var(--red); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 20px; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; margin: 14px 0 4px; font-size: 14px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 1px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; max-width: 480px; padding: 10px 13px; border: 1.5px solid var(--field); border-radius: var(--r-sm); font: 15px var(--text); color: var(--ink); background: var(--surface);
}
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
input.code { letter-spacing: .3em; font-size: 22px; max-width: 220px; font-family: var(--display); }
input.eid { font-variant-numeric: tabular-nums; letter-spacing: .04em; max-width: 100%; }
textarea { max-width: 100%; min-height: 160px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.field-error { color: var(--red); font-weight: 700; font-size: 13px; margin-top: 4px; }
.invalid { border-color: var(--red) !important; }
.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 6px 0; }
.radio input { margin-top: 4px; accent-color: var(--ink); width: 17px; height: 17px; flex: none; }
.choice { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; margin: 6px 0; font-weight: 600; cursor: pointer; max-width: 480px; }
.choice:hover { border-color: var(--field); }
.choice input { accent-color: var(--ink); width: 17px; height: 17px; margin: 0; flex: none; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--bg); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; padding: 0; }
.inline-form { display: inline; }

/* ---------- Messages ---------- */
.alert { padding: 14px 18px; border-radius: var(--r); background: var(--soft); color: var(--ink); margin-bottom: 18px; }
.alert.error { background: var(--red-bg); color: #7a1610; }
.alert.success { background: var(--green-bg); color: #164f2e; }
.alert > :last-child { margin-bottom: 0; }
.draft { border: 1.5px dashed var(--field); border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; color: var(--muted); }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.steps li:first-child { border-top: 0; }
.steps li .name { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.steps li .name::before { content: counter(s); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--s-todo-bg); color: var(--s-todo-ink); font: 800 13px var(--display); flex: none; }
.steps li.done .name::before { content: '✓'; background: var(--s-live-bg); color: var(--s-live-ink); }
.stepper { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; font-size: 13px; }
.stepper span { padding: 4px 12px; border-radius: 20px; background: var(--surface); color: var(--muted); font-weight: 600; box-shadow: var(--shadow); }
.stepper span.on { background: var(--ink); color: #fff; }

.progress { height: 10px; background: var(--soft); border-radius: 10px; margin: 8px 0 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--s-confirmed); border-radius: 10px; }
.bar { position: relative; height: 8px; background: var(--line-2); border-radius: 8px; min-width: 80px; overflow: hidden; }
.bar > div { position: absolute; inset: 0 auto 0 0; background: var(--s-confirmed); border-radius: 8px; }
.bar.full > div { background: var(--s-query); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; font-weight: 700; color: var(--muted); background: #faf9fd; }
tr.needs td:first-child { box-shadow: inset 3px 0 0 var(--s-todo); }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); margin-bottom: 20px; }
.panel .table-wrap { box-shadow: none; border-radius: 0; margin: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }
.msisdn { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

/* ---------- Chips ---------- */
.chip { display: inline-block; padding: 2px 10px; font-size: 12px; font-weight: 700; border-radius: 20px; background: var(--soft); color: var(--soft-ink); white-space: nowrap; }
.chip.solid { background: var(--ink); color: #fff; }
.chip.attention { background: var(--red-bg); color: var(--red); }
.chip.quiet { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.chip.c-todo { background: var(--s-todo-bg); color: var(--s-todo-ink); }
.chip.c-confirmed { background: var(--s-confirmed-bg); color: var(--s-confirmed-ink); }
.chip.c-ship { background: var(--s-ship-bg); color: var(--s-ship-ink); }
.chip.c-delivered { background: var(--s-delivered-bg); color: var(--s-delivered-ink); }
.chip.c-live { background: var(--s-live-bg); color: var(--s-live-ink); }
.chip.c-query { background: var(--s-query-bg); color: var(--s-query-ink); }
.chip.c-off { background: var(--soft); color: var(--muted); }
.ic { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font: 800 12px var(--display); flex: none; }

/* ---------- Number blocks (SIM step) ---------- */
.numbers .number { border-top: 1px solid var(--line-2); padding: 18px 0; }
.numbers .number:first-of-type { border-top: 0; padding-top: 0; }
.numbers .number .head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.numbers .number .msisdn { font-family: var(--display); font-size: 18px; }
.eid-wrap { margin-top: 8px; }
[hidden] { display: none !important; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 20px 38px; color: var(--muted); }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 2px; width: 18px; height: 18px; border-radius: 7px; border: 2px solid #cfc9e0; background: var(--surface); }
.timeline li::after { content: ''; position: absolute; left: 14px; top: 24px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--ink); font-weight: 700; }
.timeline li.done::before { background: var(--s-live); border-color: var(--s-live); }

.pager { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
details summary { cursor: pointer; font-weight: 700; }
.qr { width: 200px; height: 200px; image-rendering: pixelated; border-radius: var(--r-sm); border: 1px solid var(--line); }
.preview-frame { width: 100%; height: 640px; border: 0; border-radius: var(--r); background: var(--surface); }

footer.site { padding: 0 28px 32px; color: var(--muted); font-size: 13px; max-width: 1480px; margin: 0 auto; }
footer.site a { color: var(--muted); }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  h1 { font-size: 27px; }
  .top .inner { padding: 10px 16px; flex-wrap: nowrap; }
  .top .tag { display: none; }
  .top:has(.topsearch) .inner { flex-wrap: wrap; }
  .topsearch { order: 5; max-width: none; }
  .logo { height: 24px; }
  .shell { padding: 12px 16px 40px; }
  /* The left menu becomes one scrolling row of pills */
  .side { position: static; max-width: none; flex-basis: 100%; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .side .navgroup, .side .acct, .side .cta { display: none; }
  .nav { flex: none; padding: 7px 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; }
  .nav .count, .nav .tick { margin-left: 4px; }
  .card { padding: 16px; }
  .hide-sm { display: none; }
  .stat b { font-size: 24px; }
  /* Customer tables become one card per row */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line-2); padding: 8px 0; }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 4px 14px; display: flex; gap: 12px; }
  table.stack td::before { content: attr(data-label); flex: 0 0 76px; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 2px; }
  table.stack td[data-label=""]::before { display: none; }
  table.stack td select { flex: 1; }
  table.stack tr.needs td:first-child { box-shadow: none; }
  table.stack tr.needs { box-shadow: inset 3px 0 0 var(--s-todo); }
}
