html, body {
    margin: 0;
    height: 100%;
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    background: var(--neutral-layer-2, #f5f5f5);
    color: var(--neutral-foreground-rest, #1b1b1b);
}

a { color: var(--accent-fill-rest, #0f6cbd); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.92em; }
h1 { font-size: 1.5rem; font-weight: 600; margin: 0 0 8px; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 24px 0 8px; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 8px; }
h4 { font-size: 0.95rem; font-weight: 600; margin: 16px 0 6px; }
.muted { color: #616161; font-size: 0.9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Shell */
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 48px; }
.topbar .brand { color: #fff; font-weight: 700; font-size: 1.1rem; margin-right: 20px; }
.topbar .user { color: #fff; margin-right: 8px; }
.topbar .signout { display: inline; margin: 0; }
.link-button { background: none; border: none; color: #fff; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.shell { display: flex; height: calc(100vh - 48px); }
.sidenav { background: var(--neutral-layer-1, #fff); border-right: 1px solid #e0e0e0; padding-top: 8px; }
.content { flex: 1; overflow: auto; padding: 20px 24px; min-width: 0; }

/* Machines page */
.machines-page { display: flex; gap: 16px; height: calc(100vh - 90px); }
.machines-page .tree { width: 260px; flex: none; overflow-y: auto; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 8px 4px; }
.tree-item { display: flex; justify-content: space-between; padding: 4px 8px; border-radius: 4px; color: inherit; flex: 1; }
.tree-item:hover { background: #f0f0f0; text-decoration: none; }
.tree-item.selected { background: #e5f1fb; font-weight: 600; }
.tree-site { margin-left: 26px; }
.tree-customer { display: flex; align-items: center; }
.tree-toggle { width: 22px; border: none; background: none; cursor: pointer; color: #616161; }
.tree .count { color: #757575; font-weight: normal; }
.grid-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.toolbar h1 { margin: 0; }
.summary { display: flex; align-items: center; gap: 8px; }

/* Badges and status */
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.8rem; margin-right: 4px; white-space: nowrap; }
.badge.ok { background: #e7f4e4; color: #0e700e; }
.badge.warn { background: #fff4ce; color: #835b00; }
.badge.error { background: #fde7e9; color: #b10e1c; }
.badge.muted { background: #eee; color: #616161; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.dot.online { background: #13a10e; }
.dot.offline { background: #bdbdbd; }

/* Detail pages */
.page-header { margin-bottom: 12px; }
.crumbs { color: #616161; margin-bottom: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.row-actions { display: flex; gap: 8px; }
.cards { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cards .panel { flex: 1 1 420px; }
.panel { padding: 16px 20px !important; margin: 16px 0; height: auto !important; }
.form-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; flex-wrap: wrap; }
.form-row > label { width: 150px; color: #424242; }
.native-select { min-width: 280px; max-width: 480px; padding: 5px 6px; border: 1px solid #c7c7c7; border-radius: 4px; font: inherit; }
input[type=time], input[type=date], input[type=number] { padding: 4px 6px; border: 1px solid #c7c7c7; border-radius: 4px; font: inherit; }
.button-link { display: inline-block; padding: 6px 14px; border-radius: 4px; border: 1px solid #c7c7c7; color: inherit; }
.button-link.accent { background: var(--accent-fill-rest, #0f6cbd); border-color: transparent; color: #fff; }
.button-link:hover { text-decoration: none; filter: brightness(0.95); }
dl.facts { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 12px 0; }
dl.facts dt { color: #616161; }
dl.facts dd { margin: 0; }
.inline-link { margin-right: 12px; }
table.table { border-collapse: collapse; width: 100%; background: #fff; border: 1px solid #e0e0e0; }
table.table th, table.table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #eee; vertical-align: top; }
table.table th { background: #fafafa; font-weight: 600; }
table.table td.details { font-family: Consolas, monospace; font-size: 0.8rem; color: #424242; word-break: break-all; }

/* Account pages (static) */
.qr { display: flex; justify-content: center; }
.qr svg { width: 200px; height: 200px; }
.validation-message { color: #b10e1c; font-size: 0.85rem; }

/* Machines grid: fixed-height rows rendered through Blazor's Virtualize */
.mgrid { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; }
.mgrid-row { display: grid; grid-template-columns: minmax(170px, 1.4fr) 36px minmax(100px, 1fr) minmax(100px, 1fr) minmax(150px, 1.8fr) 80px 110px 150px 90px minmax(80px, 1fr); align-items: center; height: 38px; box-sizing: border-box; border-bottom: 1px solid #eee; }
.mgrid-row > * { padding: 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mgrid-row.attention { background: #fff8e6; }
.mgrid-head { background: #fafafa; font-weight: 600; border-bottom: 1px solid #e0e0e0; overflow: hidden; scrollbar-gutter: stable; flex: none; }
.mgrid-body { flex: 1; overflow-y: auto; scrollbar-gutter: stable; }
.mgrid-sort { background: none; border: none; font: inherit; font-weight: 600; text-align: left; cursor: pointer; color: inherit; }
.mgrid-sort:hover { color: var(--accent-fill-rest, #0f6cbd); }
.mgrid-empty { padding: 16px; }
.mgrid-canvas { position: relative; }
.mgrid-window { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }
.summary { white-space: nowrap; }

/* Phase 2: packages, deployments, jobs */
.badge.info { background: #e5f1fb; color: #0f548c; }
.two-col { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.two-col > .main { flex: 2 1 560px; min-width: 0; }
.two-col > .side { flex: 1 1 380px; min-width: 0; }
table.table tr.clickable { cursor: pointer; }
table.table tr.clickable:hover { background: #f5f9fd; }
table.table tr.selected { background: #e5f1fb; }
table.table td.num, table.table th.num { text-align: right; }
.problems { margin: 8px 0; padding-left: 20px; }
.problems li { margin: 4px 0; }
pre.manifest, pre.joblog { background: #1e1e1e; color: #e6e6e6; padding: 12px 14px; border-radius: 6px; overflow: auto; font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.82rem; line-height: 1.45; margin: 8px 0; }
pre.manifest { max-height: 420px; }
pre.joblog { height: 420px; white-space: pre-wrap; word-break: break-word; }
pre.command { background: #f3f2f1; padding: 8px 12px; border-radius: 4px; font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.88rem; white-space: pre-wrap; word-break: break-all; margin: 6px 0; }
tr.selected td { background: #eff6fc; }
.progress { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #e0e0e0; margin: 8px 0; }
.progress > span { display: block; height: 100%; }
.progress .ok { background: #13a10e; }
.progress .bad { background: #c50f1f; }
.progress .busy { background: #0f6cbd; }
.progress .held { background: #f2c661; }
.progress .gone { background: #9e9e9e; }
.counts { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.count-tile { background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 8px 14px; min-width: 92px; cursor: pointer; }
.count-tile.active { border-color: var(--accent-fill-rest, #0f6cbd); box-shadow: 0 0 0 1px var(--accent-fill-rest, #0f6cbd); }
.count-tile b { display: block; font-size: 1.3rem; }
.count-tile span { color: #616161; font-size: 0.85rem; }
.steps { display: flex; gap: 8px; margin: 12px 0 16px; }
.steps .step { padding: 6px 14px; border-radius: 16px; background: #eee; color: #616161; }
.steps .step.current { background: var(--accent-fill-rest, #0f6cbd); color: #fff; }
.steps .step.done { background: #e7f4e4; color: #0e700e; }
.picker { max-height: 340px; overflow: auto; border: 1px solid #e0e0e0; border-radius: 6px; padding: 8px 12px; background: #fff; }
.picker label { display: block; padding: 2px 0; cursor: pointer; }
.picker .site { margin-left: 26px; }
.chip { display: inline-block; background: #e5f1fb; border-radius: 12px; padding: 2px 4px 2px 10px; margin: 2px 4px 2px 0; }
.chip button { border: none; background: none; cursor: pointer; color: #616161; }
.secret-mask { letter-spacing: 2px; color: #616161; }
.wrap { word-break: break-all; }
.pager { display: flex; gap: 8px; align-items: center; margin: 8px 0; }

/* Phase 3: baselines, drift, provisioning */
.filter-check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
table.table tr.why td { background: #fafafa; color: #424242; white-space: normal; }
table.stack th { vertical-align: bottom; font-weight: 600; }
table.stack td.stack-win { background: #e7f4e4; font-weight: 600; }
table.stack td.stack-lost { color: #9e9e9e; text-decoration: line-through; }
table.stack td.stack-conflict { box-shadow: inset 0 0 0 2px #f2c661; }

/* Phase 4: target picker, rollout strategy, live view, bulk actions, audit log */
.topbar .role { opacity: 0.75; font-size: 0.85em; margin-left: 4px; }
.target-tree { max-height: 420px; }
.tnode { display: flex; align-items: center; gap: 6px; padding: 2px 0; white-space: nowrap; }
.tnode.level1 { margin-left: 18px; }
.tnode.level2 { margin-left: 40px; }
.tnode.level3 { margin-left: 62px; }
.tnode.revealed { background: #fff4ce; border-radius: 4px; }
.tick { display: inline-block; width: 15px; height: 15px; border: 1px solid #8a8a8a; border-radius: 3px; background: #fff; cursor: pointer; position: relative; flex: none; }
.tick.ticked { background: var(--accent-fill-rest, #0f6cbd); border-color: var(--accent-fill-rest, #0f6cbd); }
.tick.ticked::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tick.partial { background: #fff; border-color: var(--accent-fill-rest, #0f6cbd); }
.tick.partial::after { content: ""; position: absolute; left: 3px; top: 3px; width: 7px; height: 7px; background: var(--accent-fill-rest, #0f6cbd); border-radius: 1px; }
.tag-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.tag-bar input, .filter-bar input:not([type=checkbox]) { padding: 4px 6px; border: 1px solid #c7c7c7; border-radius: 4px; font: inherit; }
.search-hit { padding: 2px 0; }
.rules-line { margin: 8px 0; white-space: normal; }
.wave-list { margin: 4px 0; }
.wave-list summary { cursor: pointer; }
.wave-machines { margin: 4px 0 8px 18px; color: #424242; font-size: 0.9em; }
.strategy-box { margin: 8px 0; padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 6px; background: #fafafa; }
.strategy-box summary { cursor: pointer; }
.waves { margin: 12px 0; }
.wave-row { display: grid; grid-template-columns: 150px 1fr 80px 260px; align-items: center; gap: 12px; }
.wave-row .progress { margin: 4px 0; }
.wave-count { text-align: right; font-variant-numeric: tabular-nums; }
.wave-state { color: #616161; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0; color: #424242; font-size: 0.9em; }
.site-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 16px; }
.site-tiles { background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 6px 10px; min-width: 120px; max-width: 420px; }
.site-tiles.struggling { border-color: #c50f1f; box-shadow: 0 0 0 1px #c50f1f; }
.site-name { font-weight: 600; font-size: 0.9em; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles { display: flex; flex-wrap: wrap; gap: 3px; }
.tile { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: #d6d6d6; cursor: pointer; box-sizing: border-box; }
.tile.done { background: #13a10e; }
.tile.running { background: #0f6cbd; }
.tile.waiting { background: #d6d6d6; }
.tile.failed { background: #c50f1f; }
.tile.window { background: #fff; border: 2px solid #8a8a8a; }
.tile.missed { background: #f2c661; border: 2px dashed #835b00; }
.tile.deferred { background: #f2c661; }
.tile.cancelled { background: #9e9e9e; }
.tile.selected { outline: 2px solid #1b1b1b; outline-offset: 1px; }
.tile.picked { outline: 2px solid #c50f1f; outline-offset: 1px; }
.legend .tile { cursor: default; vertical-align: -2px; margin-right: 3px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.native-select.compact { min-width: 0; max-width: 200px; padding: 4px 6px; }
.columns-menu { position: relative; }
.columns-menu summary { cursor: pointer; padding: 4px 8px; border: 1px solid #c7c7c7; border-radius: 4px; background: #fff; list-style: none; white-space: nowrap; }
.columns-menu > div { position: absolute; right: 0; z-index: 20; background: #fff; border: 1px solid #c7c7c7; border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 200px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 10px; background: #e5f1fb; border-radius: 6px; }
.precheck { padding-left: 20px; }
.precheck li { margin: 8px 0; }
.precheck label { margin-left: 10px; cursor: pointer; white-space: nowrap; }
.audit-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
table.audit td.what { max-width: 520px; }
table.audit pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-family: Consolas, monospace; font-size: 0.8rem; color: #424242; }

/* Phase 5: dashboard, health strip */
.dash-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 4px; }
.dash-tile { display: block; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px 18px; min-width: 150px; color: inherit; border-left-width: 4px; }
.dash-tile:hover { text-decoration: none; border-color: var(--accent-fill-rest, #0f6cbd); }
.dash-tile span { display: block; color: #616161; font-size: 0.9rem; }
.dash-tile b { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.dash-tile b small { font-size: 1rem; font-weight: 400; color: #616161; }
.dash-tile.warn { border-left-color: #f2c661; }
.dash-tile.error { border-left-color: #c50f1f; }
ul.attention { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; }
ul.attention li { padding: 8px 12px; border-bottom: 1px solid #eee; display: flex; gap: 8px; }
ul.attention li:last-child { border-bottom: none; }
ul.attention li.error .mark { color: #c50f1f; }
ul.attention li.warn .mark { color: #b77e00; }
ul.attention a { color: inherit; }
table.activity td.when { white-space: nowrap; color: #616161; width: 1%; }
table.activity td.who { white-space: nowrap; font-weight: 600; width: 1%; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.health-strip { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 16px; }
.health-item { display: block; background: #fff; border: 1px solid #e0e0e0; border-top: 3px solid #bdbdbd; border-radius: 6px; padding: 8px 14px; min-width: 150px; color: inherit; }
a.health-item:hover { text-decoration: none; border-color: var(--accent-fill-rest, #0f6cbd); }
.health-item span { display: block; color: #616161; font-size: 0.85rem; }
.health-item b { display: block; font-size: 1.1rem; }
.health-item small { display: block; color: #616161; }
.health-item.ok { border-top-color: #13a10e; }
.health-item.warn { border-top-color: #f2c661; }
.health-item.error { border-top-color: #c50f1f; }
.health-item.versions { max-width: 520px; }
.health-item.versions .badge { margin-top: 4px; }
.history-changes { margin: 4px 0; padding-left: 18px; color: #424242; }
.form-row > label.filter-check { width: auto; }

/* Sign-in page: the single sign-on button (Phase 5B). */
/* Settings: one page heading with a tab per settings page */
.settings-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid #d1d1d1; margin: 0 0 12px; }
.settings-tabs a.settings-tab { padding: 8px 14px; color: #424242; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 500; }
.settings-tabs a.settings-tab:hover { color: #0f6cbd; background: #f5f9fd; }
.settings-tabs a.settings-tab.active { color: #0f6cbd; border-bottom-color: #0f6cbd; font-weight: 600; }
.settings-intro { color: #616161; margin: 0 0 16px; }

/* Sign-in pages (AccountLayout): RetailTouch look, as on RetailTouch Enterprise */
.login-split { min-height: 100vh; display: flex; background: #0e0e10; color: #ececef; font-size: 16px; line-height: 1.5; font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; padding: 24px; box-sizing: border-box; gap: 24px; }
.login-split__image { flex: 0 0 48%; display: flex; min-height: calc(100vh - 48px); overflow: hidden; }
.login-brand { flex: 1 1 56%; position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; background: linear-gradient(165deg, #0b2a4c 0%, #0a2038 35%, #091a2f 60%, #0b1626 100%); padding: 9% 16px 32px; }
.login-brand__logo { width: 112%; max-width: 640px; height: auto; -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%), linear-gradient(to bottom, transparent 0%, #000 7%, #000 93%, transparent 100%); -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%), linear-gradient(to bottom, transparent 0%, #000 7%, #000 93%, transparent 100%); mask-composite: intersect; }
.login-brand__foot { position: absolute; left: 48px; bottom: 40px; color: #ececef; letter-spacing: 3px; text-transform: uppercase; font-size: 15px; line-height: 1.6; }
.login-brand__bar { display: block; width: 36px; height: 3px; background: #e0a526; margin-bottom: 18px; }
.login-photo { flex: 0 0 44%; background: #0e0e10 url("../images/login-photo-retailtouch.jpg") center / cover no-repeat; }
.login-split__form { flex: 1; display: flex; align-items: center; justify-content: center; }
.login-panel { width: 380px; max-width: 100%; font-size: 16px; }
.login-title { font-size: 28px; font-weight: 300; background: linear-gradient(90deg, #f7d774, #a86f0c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #e0a526; margin-bottom: 20px; line-height: 1.25; }
.login-panel h1 { font-size: 16px; font-weight: 400; color: #c9ccd1; margin: 0 0 16px; }
.login-panel p { color: #c9ccd1; }
.login-panel a { color: #e0a526; }
.login-panel label { display: block; margin: 0 0 16px; color: #c9ccd1; font-size: 16px; }
.login-panel input { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; padding: 6px 12px; height: 38px; font: inherit; color: #fff; background: rgba(70, 90, 126, 0.4); border: 1px solid #34343a; border-radius: 4px; outline: none; }
.login-panel input:focus { border-color: #e0a526; box-shadow: 0 0 0 3.2px rgba(224, 165, 38, 0.14); }
.login-panel button { padding: 6px 16px; font: inherit; color: #0a0a0b; background: #e0a526; border: 1px solid #a86f0c; border-radius: 4px; cursor: pointer; }
.login-panel button:hover { background: #f0b83a; }
.login-panel .validation-message { color: #f19ca5; font-size: 14px; margin: -10px 0 12px; }
.login-panel .qr { background: #fff; padding: 12px; border-radius: 4px; display: inline-block; margin: 8px 0; }
.login-panel .qr svg { display: block; }
.login-panel code { color: #f7d774; }
.account-error { color: #b10e1c; background: #fde7e9; padding: 8px 10px; border-radius: 4px; }
.login-panel .account-error { color: #f19ca5; background: rgba(177, 14, 28, 0.15); border: 1px solid #b33a46; padding: 10px 14px; }
.account-note { margin-top: 16px; font-size: 0.9rem; }
.account-key { text-align: center; letter-spacing: 1px; }
.login-panel a.sso-button { display: block; text-align: center; padding: 8px 12px; border-radius: 4px; background: #e0a526; color: #0a0a0b; text-decoration: none; border: 1px solid #a86f0c; }
.login-panel a.sso-button:hover { background: #f0b83a; }
.login-panel p.muted { margin: 14px 0 12px; font-size: 14px; color: #8b8e94; }
@media (max-width: 900px) { .login-split { padding: 16px; } .login-split__image { display: none; } }