/* BigScoots look: bright brand blue, navy, a yellow call-to-action, soft white cards. */
:root {
  --blue: #415aff; --blue-dark: #2f45e0; --navy: #263490; --blue-soft: #eef0ff; --blue-line: #d5dbff;
  --yellow: #f6c006; --yellow-dark: #e0ae00;
  --bg: #f4f6fd; --panel: #fff; --line: #e4e7f2; --text: #2d2d2d; --muted: #6b7085;
  --danger: #d23b3b; --danger-soft: #fdeeee; --good: #1f8a4c;
  --st-pending: #eceef5; --st-progress: #e2e7ff; --st-initial: #ffe8cc; --st-final: #d9f1f7;
  --st-migrated: #d6f2dc; --st-incomplete: #fff3b0; --st-hold: #ece6f6; --st-cancelled: #f0f0f0;
  --radius: 12px; --shadow: 0 1px 2px rgba(38, 52, 144, .06), 0 4px 14px rgba(38, 52, 144, .06);
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; font-weight: 600; margin: 0; letter-spacing: -.01em; color: var(--text); }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.muted { color: var(--muted); }
.pad { padding: 24px; }
.small { font-size: 12.5px; }
code, pre, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 60px; background: linear-gradient(90deg, var(--blue) 0%, #4f64ff 60%, #5a6dff 100%); color: #fff; position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 10px rgba(38, 52, 144, .18); }
.topbar .brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; white-space: nowrap; }
.topbar .brand:hover { text-decoration: none; }
.topbar .brand img { height: 26px; display: block; }
.topbar .brand .tag { font-size: 12px; padding: 3px 8px; border-radius: 20px; background: rgba(255,255,255,.18); font-weight: 600; letter-spacing: .02em; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { color: rgba(255,255,255,.88); padding: 7px 14px; border-radius: 20px; font-weight: 500; }
.topbar nav a:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.topbar nav a.active { background: #fff; color: var(--blue); }
.topbar .me { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #fff; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }

main { padding: 28px 24px 60px; max-width: 1440px; margin: 0 auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.header { margin-bottom: 20px; }
.crumb { font-size: 13px; margin-bottom: 4px; display: inline-block; }

/* Buttons and inputs */
button, .btn { font: inherit; font-weight: 500; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: background .12s, border-color .12s; }
button:hover { border-color: var(--blue-line); background: var(--blue-soft); }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
button.cta { background: var(--yellow); border-color: var(--yellow); color: var(--text); font-weight: 600; }
button.cta:hover { background: var(--yellow-dark); border-color: var(--yellow-dark); }
button.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
button.link { border: 0; background: none; color: var(--blue); padding: 0; font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid #d8dcea; border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--text); }
textarea { width: 100%; min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--blue-line); border-color: var(--blue); }
select:disabled, input:disabled, textarea:disabled { background: #f6f7fb; color: var(--muted); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
label.field > input, label.field > select, label.field > textarea { font-size: 14px; color: var(--text); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.section { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fbfcff; }
.section > h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--navy); }

/* Dashboard */
.hello { font-size: 15px; color: var(--muted); margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile .num { font-size: 30px; font-weight: 600; line-height: 1.1; color: var(--text); }
.tile .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tile.hero { background: linear-gradient(135deg, var(--blue), var(--navy)); border: 0; }
.tile.hero .num, .tile.hero .lbl { color: #fff; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; color: inherit; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s; }
.card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--blue-line); box-shadow: 0 8px 24px rgba(38, 52, 144, .12); }
.card .title { font-weight: 600; font-size: 17px; }
.meter { height: 8px; background: #e9ecf7; border-radius: 4px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.meter-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.meter-label b { color: var(--text); font-weight: 600; }

/* Chips: always a dot + a word, never colour alone */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--text); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .45; }
.chip.plain::before { display: none; }
.st-pending { background: var(--st-pending); } .st-in_progress { background: var(--st-progress); }
.st-initial_sync { background: var(--st-initial); } .st-final_sync { background: var(--st-final); }
.st-migrated { background: var(--st-migrated); } .st-incomplete { background: var(--st-incomplete); }
.st-on_hold { background: var(--st-hold); } .st-cancelled { background: var(--st-cancelled); color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: 30px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; box-shadow: var(--shadow); }
.tabs button { border: 0; border-radius: 22px; background: none; padding: 7px 16px; color: var(--muted); white-space: nowrap; }
.tabs button:hover { background: var(--blue-soft); color: var(--text); }
.tabs button.active { background: var(--blue); color: #fff; }

/* Tables */
.table-wrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 10px; border-bottom: 1px solid #eef0f6; text-align: left; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { background: #f7f8fd; font-size: 12px; font-weight: 600; color: var(--navy); position: sticky; top: 0; white-space: nowrap; z-index: 1; }
tbody tr:hover td { background: #f8f9ff; }
tr.tint-incomplete td { background: #fffbe0; } tr.tint-migrated td { background: #f0faf2; }
tr.tint-initial_sync td { background: #fff6ea; } tr.tint-final_sync td { background: #f0f9fc; }
tr.tint-cancelled td { color: var(--muted); }
tr.tint-cancelled td.domain { text-decoration: line-through; }
td select { padding: 4px 6px; font-size: 13px; }
td .note-cell { min-width: 180px; max-width: 320px; white-space: pre-wrap; font-size: 12.5px; color: var(--muted); }
td.domain { font-weight: 600; white-space: nowrap; }
td.domain a { color: var(--text); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; padding: 6px 12px; }
.seg button.on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }

/* Commands and labels */
.cmd { background: #1b2140; color: #e9ecff; padding: 12px 14px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.label-change { display: inline-block; background: var(--danger); color: #fff; font-weight: 700; font-size: 11.5px; padding: 3px 9px; border-radius: 4px; letter-spacing: .02em; }
.label-read { display: inline-block; background: var(--good); color: #fff; font-weight: 700; font-size: 11.5px; padding: 3px 9px; border-radius: 4px; }
.warn { background: var(--danger-soft); border: 1px solid #f2c4c4; color: #7a2020; padding: 10px 12px; border-radius: 8px; }
.info { background: var(--blue-soft); border: 1px solid var(--blue-line); padding: 10px 12px; border-radius: 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 13.5px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--blue); }
.check .who { color: var(--muted); font-size: 12px; }

/* Activity */
.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 10px 0; border-bottom: 1px solid #eef0f6; }
.log li:last-child { border-bottom: 0; }
.log .changes { margin-top: 4px; font-size: 12px; color: var(--muted); }
.log .changes b { color: var(--text); font-weight: 500; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(27, 33, 64, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 640px; padding: 24px; box-shadow: 0 20px 60px rgba(27, 33, 64, .3); }
.modal.wide { max-width: 1000px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h2 { font-size: 20px; margin: 0; }

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; max-width: 420px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.err { background: var(--danger); }
.secret { background: #fff4c2; padding: 2px 6px; border-radius: 4px; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.empty .big { font-size: 28px; margin-bottom: 6px; }

/* Agency overview */
.pri-high { background: #ffe1e1; color: #a12525; } .pri-medium { background: #f3e3ff; color: #6a2c91; } .pri-low { background: #eceef5; }
.rules { background: #fff8db; border: 1px solid #f6d977; border-left: 5px solid var(--yellow); border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 13.5px; }
.rules b { display: block; margin-bottom: 4px; color: #7a5a00; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 18px; }
.fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact > span { font-size: 12px; color: var(--muted); }
.fact > b { font-weight: 500; overflow-wrap: anywhere; }
.linkrow { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid #eef0f6; }
.linkrow > .chip { flex: none; white-space: nowrap; }
.linkrow > a { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.linkrow > .grow { display: none; }
.linkrow > button { flex: none; }
.linkrow:last-child { border-bottom: 0; }
.golive-yes { background: var(--st-migrated); } .golive-wait { background: var(--st-incomplete); }

/* Sign-in page (shared-password mode) */
body.signed-out .topbar nav, body.signed-out .topbar .me { display: none; }
.login-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 32px 28px; box-shadow: 0 10px 40px rgba(38, 52, 144, .12); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin: 0; font-size: 22px; color: var(--navy); }
.login-card p { margin: 0; }
.login-logo { height: 30px; align-self: flex-start; }
.login-card button.primary { margin-top: 6px; padding: 10px; font-size: 15px; }
.login-error { background: #fff1f1; color: #a12626; border: 1px solid #f3c4c4; border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.topbar .signout { margin-left: 6px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 12.5px; }
.topbar .signout:hover { background: rgba(255,255,255,.28); }
