:root {
  --navy: #0d1728;
  --navy-2: #14243c;
  --blue: #356fe0;
  --blue-2: #275dc3;
  --blue-soft: #edf3ff;
  --teal: #0a927d;
  --teal-soft: #e7f8f4;
  --amber: #bd7607;
  --amber-soft: #fff5dd;
  --red: #cc4242;
  --red-soft: #fff0f0;
  --purple: #7255c6;
  --purple-soft: #f1edff;
  --ink: #172033;
  --muted: #6f7b8d;
  --line: #e2e7ee;
  --canvas: #f4f6f9;
  --surface: #ffffff;
  --shadow: 0 12px 34px rgba(18, 35, 62, .09);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 15px 16px;
  color: #fff;
  background: linear-gradient(180deg, var(--navy), #091220);
  z-index: 30;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 20px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #4c86ff, #1db095); font-weight: 900; letter-spacing: -.05em; }
.brand strong { display: block; font-size: 14px; letter-spacing: .13em; }
.brand span { display: block; margin-top: 3px; color: #8fa0b7; font-size: 10px; letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 18px 0; }
.nav-heading { margin: 12px 11px 5px; color: #5d718b; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 11px; border: 0; border-radius: 10px; color: #aab7c8; background: transparent; text-align: left; font-size: 12px; font-weight: 650; transition: .15s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(62,124,238,.31), rgba(62,124,238,.1)); box-shadow: inset 3px 0 #4d88f4; }
.nav-icon { width: 20px; color: #84a0c5; text-align: center; font-size: 15px; }
.facility-card { margin-top: auto; padding: 13px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; background: rgba(255,255,255,.045); }
.facility-card strong { display: block; margin-top: 5px; font-size: 11px; }
.facility-card small { display: block; margin-top: 4px; color: #8192a7; font-size: 9px; }
.eyebrow { color: #8996a8; font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.online { margin-top: 10px; color: #9ed6cd; font-size: 9px; }
.online i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #21ba92; box-shadow: 0 0 0 3px rgba(33,186,146,.13); }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(12px); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.breadcrumb { margin-bottom: 4px; color: #9aa3b1; font-size: 9px; }
.breadcrumb span { padding: 0 4px; }
.breadcrumb b { color: #5f6e83; }
.topbar h1 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.menu-button { display: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.search-box { width: 310px; height: 41px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; color: #95a0b0; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
kbd { padding: 2px 5px; border: 1px solid #d8dee7; border-radius: 5px; background: #fff; color: #8c96a5; font-size: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.identity-switch { position: relative; min-width: 218px; height: 44px; display: grid; grid-template-columns: 34px 1fr 18px; align-items: center; gap: 8px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--navy-2); font-size: 9px; font-weight: 850; }
.identity-copy { min-width: 0; }
.identity-copy strong, .identity-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-copy strong { font-size: 10px; }
.identity-copy span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.identity-switch select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.chevron { color: #7c8798; }

.content { max-width: 1550px; margin: 0 auto; padding: 24px 28px 48px; }
.loading-card { padding: 46px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--muted); text-align: center; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h2 { margin: 0 0 5px; font-size: 22px; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 16px rgba(20,35,58,.035); overflow: hidden; }
.card-pad { padding: 18px; }
.card-head { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 12px; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.stat-card { position: relative; min-height: 132px; padding: 16px; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -18px; top: -18px; width: 74px; height: 74px; border-radius: 50%; background: var(--blue-soft); opacity: .8; }
.stat-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 750; }
.stat-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: 13px; }
.stat-value { position: relative; z-index: 1; margin: 12px 0 4px; font-size: 28px; font-weight: 850; letter-spacing: -.04em; }
.stat-foot { position: relative; z-index: 1; color: var(--muted); font-size: 8px; }

.btn { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; color: #334159; background: #fff; font-size: 10px; font-weight: 750; transition: .15s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(20,38,66,.08); }
.btn:disabled { cursor: not-allowed; opacity: .4; }
.btn-primary { border-color: var(--blue); color: #fff; background: var(--blue); }
.btn-primary:hover:not(:disabled) { background: var(--blue-2); }
.btn-success { border-color: var(--teal); color: #fff; background: var(--teal); }
.btn-danger { border-color: var(--red); color: #fff; background: var(--red); }
.btn-dark { border-color: var(--navy-2); color: #fff; background: var(--navy-2); }
.btn-sm { min-height: 29px; padding: 5px 9px; border-radius: 7px; font-size: 8px; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: #5e6b7d; background: #fff; font-size: 17px; }

.badge { min-height: 22px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 8px; font-weight: 850; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-blue { color: #2a60c7; background: var(--blue-soft); }
.badge-green { color: #087a68; background: var(--teal-soft); }
.badge-amber { color: #9b6208; background: var(--amber-soft); }
.badge-red { color: #b33737; background: var(--red-soft); }
.badge-purple { color: #6045ad; background: var(--purple-soft); }
.badge-grey { color: #667285; background: #eef1f5; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 13px; border-bottom: 1px solid var(--line); color: #8994a5; background: #fafbfc; text-align: left; font-size: 7.5px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
td { padding: 11px 13px; border-bottom: 1px solid #edf0f4; vertical-align: middle; font-size: 9.5px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f9fbff; }
.id-link { color: var(--blue); font-weight: 800; }
.asset-cell { display: flex; align-items: center; gap: 9px; }
.device-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: #4d5d73; background: #eef3fa; font-size: 13px; }
.asset-cell strong, .asset-cell small { display: block; }
.asset-cell strong { font-size: 9.5px; }
.asset-cell small { margin-top: 2px; color: var(--muted); font-size: 8px; }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { width: auto; min-width: 180px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { color: #778397; font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.input, .select, .textarea { width: 100%; padding: 9px 10px; border: 1px solid #dce2ea; border-radius: 9px; outline: none; color: var(--ink); background: #fff; font-size: 10px; }
.input:focus, .select:focus, .textarea:focus { border-color: #85a9ef; box-shadow: 0 0 0 3px rgba(53,111,224,.08); }
.textarea { min-height: 78px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.section-title { grid-column: 1 / -1; margin-top: 5px; padding-bottom: 7px; border-bottom: 1px solid var(--line); color: #38465c; font-size: 10px; font-weight: 850; }
.help { color: var(--muted); font-size: 8px; line-height: 1.45; }
.checkbox-row { display: flex; align-items: center; gap: 8px; min-height: 38px; font-size: 10px; }
.checkbox-row input { accent-color: var(--blue); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.alert { display: flex; gap: 10px; padding: 12px 13px; border: 1px solid; border-radius: 11px; font-size: 9.5px; line-height: 1.5; }
.alert strong { display: block; margin-bottom: 2px; }
.alert-blue { border-color: #d7e4fb; color: #36557f; background: #f2f7ff; }
.alert-green { border-color: #cdece5; color: #256d60; background: #f1fbf8; }
.alert-amber { border-color: #f0dca7; color: #775a18; background: #fff9eb; }
.alert-red { border-color: #f0caca; color: #813939; background: #fff3f3; }
.empty { padding: 40px 20px; color: var(--muted); text-align: center; font-size: 10px; }

.zone-list { display: grid; gap: 9px; }
.zone-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; }
.zone-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-weight: 850; }
.zone-row strong, .zone-row small { display: block; }
.zone-row strong { font-size: 9.5px; }
.zone-row small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.zone-count { font-size: 17px; font-weight: 850; }

.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pipeline-step { min-height: 84px; padding: 12px; border-right: 1px solid var(--line); background: #fff; }
.pipeline-step:last-child { border-right: 0; }
.pipeline-step span { display: block; color: #919baa; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.pipeline-step strong { display: block; margin-top: 9px; font-size: 20px; }
.pipeline-step small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(7,15,29,.48); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(720px, 100%); display: flex; flex-direction: column; background: #fff; box-shadow: -24px 0 80px rgba(7,15,29,.22); }
.drawer-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 4px 0 0; font-size: 18px; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px 36px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.status-strip { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.status-chip { padding: 11px 9px; border-right: 1px solid var(--line); background: #fff; }
.status-chip:last-child { border-right: 0; }
.status-chip span { display: block; color: #929dab; font-size: 7px; text-transform: uppercase; }
.status-chip strong { display: block; margin-top: 5px; font-size: 8.5px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 20px; }
.detail { padding: 10px 0; border-bottom: 1px solid #edf0f4; }
.detail span { display: block; color: #8e98a8; font-size: 7.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.detail strong { display: block; margin-top: 4px; font-size: 9.5px; word-break: break-word; }
.detail.full { grid-column: 1 / -1; }
.check-list { display: grid; gap: 8px; }
.check-row { display: grid; grid-template-columns: 24px 1fr; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.check-mark { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; font-size: 10px; font-weight: 900; }
.check-pass { color: var(--teal); background: var(--teal-soft); }
.check-fail { color: var(--red); background: var(--red-soft); }
.check-row strong, .check-row small { display: block; }
.check-row strong { font-size: 9px; }
.check-row small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 7px; bottom: 7px; width: 1px; background: #dce2e9; }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ""; position: absolute; left: -17px; top: 3px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px #b8c6d9; }
.timeline-item strong { display: block; font-size: 9px; }
.timeline-item p { margin: 3px 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.timeline-item time { color: #a0a8b4; font-size: 7.5px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(7,15,29,.6); }
.modal { width: min(650px, 100%); max-height: 92vh; overflow: auto; border-radius: 15px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 14px; }
.modal-body { padding: 18px; }

.permission-matrix th:first-child, .permission-matrix td:first-child { position: sticky; left: 0; z-index: 2; min-width: 190px; background: #fff; }
.permission-matrix th:first-child { background: #fafbfc; }
.perm { width: 22px; height: 22px; display: grid; place-items: center; margin: auto; border-radius: 7px; font-size: 8px; font-weight: 900; }
.perm-yes { color: var(--teal); background: var(--teal-soft); }
.perm-no { color: #a0a8b4; background: #f1f3f6; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 140; max-width: 420px; padding: 12px 15px; border-radius: 11px; color: #fff; background: var(--navy-2); box-shadow: var(--shadow); font-size: 10px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #9d3131; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1 { grid-template-columns: 1fr; }
  .search-box { width: 230px; }
  .identity-switch { min-width: 72px; grid-template-columns: 34px 1fr; }
  .identity-copy { display: none; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pipeline-step:nth-child(3) { border-right: 0; }
}
@media (max-width: 850px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; width: 245px; transition: .18s ease; }
  .sidebar.open { left: 0; }
  .menu-button { display: block; }
  .topbar { padding: 0 15px; }
  .content { padding: 18px 15px 40px; }
  .search-box { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .actions { justify-content: flex-start; }
  .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .status-chip { border-bottom: 1px solid var(--line); }
}
@media (max-width: 540px) {
  .grid-4 { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline-step:nth-child(2n) { border-right: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail.full { grid-column: auto; }
  .topbar h1 { font-size: 15px; }
  .breadcrumb { display: none; }
  .content { padding-left: 10px; padding-right: 10px; }
}

/* Phase 2: authentication, scanning, evidence, containers and agent controls */
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 16% 18%, rgba(53,111,224,.18), transparent 35%), radial-gradient(circle at 86% 82%, rgba(10,146,125,.15), transparent 34%), linear-gradient(145deg, #08111f, #14243c 58%, #0c1728); }
.login-shell { width: min(1050px, 100%); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .75fr); overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 24px; background: rgba(255,255,255,.98); box-shadow: 0 38px 120px rgba(0,0,0,.38); }
.login-brand-panel { position: relative; min-height: 640px; display: flex; flex-direction: column; justify-content: space-between; padding: 52px; color: #fff; background: linear-gradient(150deg, rgba(13,23,40,.97), rgba(20,44,76,.98)); overflow: hidden; }
.login-brand-panel::before, .login-brand-panel::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-brand-panel::before { width: 330px; height: 330px; right: -125px; top: -110px; background: rgba(77,136,244,.18); }
.login-brand-panel::after { width: 240px; height: 240px; left: -100px; bottom: -70px; background: rgba(33,186,146,.13); }
.login-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.login-logo .brand-mark { width: 54px; height: 54px; border-radius: 15px; font-size: 17px; }
.login-logo strong { display: block; font-size: 17px; letter-spacing: .13em; }
.login-logo span { display: block; margin-top: 4px; color: #9db0c7; font-size: 10px; letter-spacing: .06em; }
.login-copy { position: relative; z-index: 1; max-width: 540px; }
.login-copy .eyebrow { color: #75a5ff; }
.login-copy h1 { margin: 14px 0 16px; max-width: 520px; font-size: clamp(32px, 4.3vw, 54px); line-height: 1.02; letter-spacing: -.055em; }
.login-copy p { margin: 0; max-width: 480px; color: #aabbd0; font-size: 14px; line-height: 1.75; }
.login-controls { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.login-control { padding: 14px; border: 1px solid rgba(255,255,255,.09); border-radius: 13px; background: rgba(255,255,255,.045); }
.login-control strong { display: block; font-size: 11px; }
.login-control small { display: block; margin-top: 5px; color: #8297b2; font-size: 8.5px; line-height: 1.45; }
.login-card { align-self: center; padding: 48px 42px; }
.login-card h2 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.045em; }
.login-card > p { margin: 0 0 25px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.login-form { display: grid; gap: 15px; }
.login-form .input { min-height: 46px; padding: 12px 13px; font-size: 12px; }
.login-form .btn { min-height: 47px; margin-top: 3px; font-size: 11px; }
.login-form .field label { font-size: 9px; }
.mfa-field { display: none; }
.mfa-field.visible { display: block; }
.login-error { min-height: 18px; margin: 2px 0 0; color: var(--red); font-size: 9.5px; line-height: 1.4; }
.demo-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-accounts h3 { margin: 0 0 5px; font-size: 10px; }
.demo-accounts > p { margin: 0 0 10px; color: var(--muted); font-size: 8.5px; }
.demo-account-list { display: grid; gap: 7px; max-height: 208px; overflow: auto; padding-right: 3px; }
.demo-account { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; text-align: left; }
.demo-account:hover { border-color: #b9cced; background: #f5f8ff; }
.demo-account .avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 8px; }
.demo-account strong, .demo-account small { display: block; }
.demo-account strong { font-size: 8.5px; }
.demo-account small { margin-top: 2px; color: var(--muted); font-size: 7.5px; }
.demo-account code { color: #617087; font-size: 7.5px; }

.identity-switch { appearance: none; text-align: left; }
.identity-switch:hover { border-color: #bdcae0; box-shadow: 0 5px 17px rgba(18,35,62,.07); }
.identity-switch:focus-visible { outline: 3px solid rgba(53,111,224,.16); border-color: var(--blue); }
.session-panel { display: grid; gap: 10px; }
.session-user { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #f9fbfe; }
.session-user .avatar { width: 40px; height: 40px; }
.session-user strong, .session-user small { display: block; }
.session-user small { margin-top: 3px; color: var(--muted); font-size: 8.5px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.metrics-grid.compact { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric-box { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.metric-box span { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.metric-box strong { display: block; margin-top: 7px; font-size: 19px; }
.metric-box small { display: block; margin-top: 4px; color: var(--muted); font-size: 7.5px; }
.subline { display: block; margin-top: 3px; color: var(--muted); font-size: 7.5px; line-height: 1.35; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.muted { color: var(--muted); }
code { padding: 2px 5px; border-radius: 5px; background: #f1f4f8; color: #43516a; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.hash { display: inline-block; max-width: 155px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.clickable { cursor: pointer; }

.intake-guide { counter-reset: intake; display: grid; gap: 9px; }
.intake-guide > div { position: relative; min-height: 46px; padding: 10px 10px 10px 47px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.intake-guide > div::before { counter-increment: intake; content: counter(intake); position: absolute; left: 10px; top: 9px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 900; }
.intake-guide strong, .intake-guide small { display: block; }
.intake-guide strong { font-size: 9px; }
.intake-guide small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }

.scan-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 16px; }
.scan-card { min-height: 315px; }
.scan-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.scan-form .input { min-height: 48px; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.scan-form .btn { min-height: 48px; }
.scan-help { margin: 10px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.5; }
.scan-result { margin-top: 14px; }
.scan-hit { padding: 14px; border: 1px solid #cfe0fb; border-radius: 11px; background: #f3f7ff; }
.scan-hit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.scan-hit h3 { margin: 0; font-size: 14px; }
.scan-hit p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.scan-hit .detail-grid { margin-top: 8px; }
.scan-miss { padding: 13px; border: 1px solid #f0d4d4; border-radius: 10px; color: #8a3b3b; background: #fff5f5; font-size: 9px; }
.camera-wrap { position: relative; min-height: 250px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #bdc8d6; border-radius: 12px; background: #101621; }
.camera-wrap video { width: 100%; height: 100%; min-height: 250px; object-fit: cover; }
.camera-placeholder { padding: 25px; color: #90a0b4; text-align: center; font-size: 9px; line-height: 1.5; }
.camera-target { position: absolute; left: 12%; right: 12%; top: 35%; height: 30%; border: 2px solid rgba(255,255,255,.72); border-radius: 12px; box-shadow: 0 0 0 1000px rgba(0,0,0,.26); pointer-events: none; }

.warehouse-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.warehouse-card { position: relative; min-height: 145px; }
.warehouse-card .zone-code { display: inline-grid; place-items: center; min-width: 36px; height: 28px; padding: 0 7px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 900; }
.warehouse-card h3 { margin: 13px 0 4px; font-size: 12px; }
.warehouse-card p { margin: 0; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.warehouse-count { position: absolute; right: 15px; top: 14px; font-size: 23px; font-weight: 850; }
.warehouse-count small { display: block; color: var(--muted); font-size: 7px; font-weight: 700; text-align: right; text-transform: uppercase; }

.container-card { min-height: 205px; }
.container-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.container-card h3 { margin: 11px 0 3px; font-size: 13px; }
.container-card > p { margin: 0; color: var(--muted); font-size: 8.5px; }
.seal-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.seal-strip span, .seal-strip strong { display: block; }
.seal-strip span { color: var(--muted); font-size: 7.5px; text-transform: uppercase; }
.seal-strip strong { margin-top: 3px; font-size: 9px; }

.checklist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.template-card { min-height: 235px; display: flex; flex-direction: column; }
.template-card h3 { margin: 12px 0 4px; font-size: 13px; }
.template-card p { margin: 0; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.template-card .template-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
.template-items { display: grid; gap: 8px; }
.template-item { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.template-item-index { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 900; }
.template-item strong, .template-item small { display: block; }
.template-item strong { font-size: 9px; }
.template-item small { margin-top: 3px; color: var(--muted); font-size: 7.5px; }
.checklist-result-row { display: grid; grid-template-columns: minmax(180px,1fr) 155px minmax(150px,.8fr); align-items: end; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist-result-row:last-child { border-bottom: 0; }
.checklist-result-label strong, .checklist-result-label small { display: block; }
.checklist-result-label strong { font-size: 9px; }
.checklist-result-label small { margin-top: 3px; color: var(--muted); font-size: 7.5px; }

.evidence-preview { min-height: 95px; display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfd; }
.evidence-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-size: 19px; }
.evidence-preview strong, .evidence-preview small { display: block; }
.evidence-preview small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; }

.agent-card { min-height: 245px; }
.agent-head { display: flex; align-items: center; justify-content: space-between; }
.agent-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--teal); background: var(--teal-soft); font-size: 17px; }
.agent-card h3 { margin: 14px 0 4px; font-size: 13px; }
.agent-card > p { margin: 0 0 10px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8.5px; }
.secret-key { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fc; }
.secret-key code { display: block; overflow: auto; padding: 10px; white-space: nowrap; }
.agent-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }

.modal-wide { width: min(900px, 100%); }
.modal-xl { width: min(1120px, 100%); }
.loading-card.compact { padding: 18px; }
.inline-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.divider { height: 1px; margin: 16px 0; background: var(--line); }
.label-preview { display: grid; place-items: center; min-height: 220px; padding: 20px; border: 1px dashed #c4cfdd; border-radius: 12px; background: #f7f9fc; }
.label-preview iframe { width: 360px; max-width: 100%; height: 210px; border: 0; background: #fff; box-shadow: 0 7px 25px rgba(20,35,58,.12); }

@media (max-width: 1180px) {
  .metrics-grid, .metrics-grid.compact { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .warehouse-grid, .checklist-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; max-width: 560px; }
  .login-brand-panel { min-height: 330px; padding: 35px; }
  .login-controls { display: none; }
  .login-card { padding: 35px; }
  .scan-layout { grid-template-columns: 1fr; }
  .warehouse-grid, .checklist-grid { grid-template-columns: 1fr; }
  .checklist-result-row { grid-template-columns: 1fr; align-items: stretch; }
}
@media (max-width: 600px) {
  .login-view { padding: 0; }
  .login-shell { min-height: 100vh; border: 0; border-radius: 0; }
  .login-brand-panel { min-height: 250px; padding: 25px; }
  .login-copy h1 { font-size: 32px; }
  .login-copy p { font-size: 11px; }
  .login-card { padding: 28px 22px 36px; }
  .metrics-grid, .metrics-grid.compact { grid-template-columns: 1fr; }
  .scan-form { grid-template-columns: 1fr; }
  .secret-key { grid-template-columns: 1fr; }
}

/* Phase 2 login markup alignment */
.login-brand-panel { justify-content: flex-start; gap: 0; }
.login-brand-panel > .login-logo { width: 58px; height: 58px; display: grid; place-items: center; flex: 0 0 auto; margin-bottom: 42px; border-radius: 16px; background: linear-gradient(145deg, #4c86ff, #1db095); color: #fff; font-size: 18px; font-weight: 900; letter-spacing: -.05em; box-shadow: 0 14px 36px rgba(37,97,201,.28); }
.login-brand-panel > .eyebrow.light { position: relative; z-index: 1; color: #77a9ff; }
.login-brand-panel > h1 { position: relative; z-index: 1; max-width: 520px; margin: 14px 0 16px; font-size: clamp(36px, 4.3vw, 56px); line-height: 1.02; letter-spacing: -.055em; }
.login-brand-panel > p { position: relative; z-index: 1; max-width: 490px; margin: 0; color: #aabbd0; font-size: 14px; line-height: 1.75; }
.login-control-list { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: auto; padding-top: 34px; }
.login-control-list > div { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 9px; padding: 13px; border: 1px solid rgba(255,255,255,.085); border-radius: 12px; background: rgba(255,255,255,.04); }
.login-control-list b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #78a8ff; background: rgba(77,136,244,.13); font-size: 8px; }
.login-control-list span { color: #b0bfd1; font-size: 9px; line-height: 1.4; }
.login-subtitle { margin-bottom: 24px !important; }
.input-lg { min-height: 47px; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .25em; font-weight: 750; }
.login-button { width: 100%; }
.demo-login-panel { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.demo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.demo-head strong, .demo-head span { display: block; }
.demo-head strong { font-size: 9.5px; }
.demo-head div > span { margin-top: 3px; color: var(--muted); font-size: 7.8px; line-height: 1.4; }
#demo-accounts.demo-accounts { display: grid; gap: 6px; max-height: 190px; overflow: auto; margin: 0; padding: 0 3px 0 0; border: 0; }
.demo-account { grid-template-columns: 28px 1fr; }
.demo-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--navy-2); font-size: 7.5px; font-weight: 850; }
.login-footnote { display: block; margin-top: 18px; color: #939eac; font-size: 7.5px; line-height: 1.55; }
.login-card .alert { margin-top: 12px; }

@media (max-width: 900px) {
  .login-brand-panel > .login-logo { margin-bottom: 22px; }
  .login-brand-panel > h1 { font-size: 36px; }
  .login-brand-panel > p { font-size: 11px; }
  .login-control-list { display: none; }
}


/* Phase 3 operational completion */
.allocation-pill { display: inline-flex; align-items: center; gap: 5px; margin: 2px 4px 2px 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: #f7f9fc; color: var(--navy); font-size: 7.8px; font-weight: 750; white-space: nowrap; }
.allocation-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }
.commercial-metrics .stat-card { min-height: 116px; }
.table-wrap .input.compact { min-height: 32px; padding: 7px 8px; font-size: 8px; }
.qty-summary { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.qty-summary span { padding: 6px 8px; border-radius: 8px; background: #f3f6fa; color: var(--muted); font-size: 8px; }
.fulfilment-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.fulfilment-step { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.fulfilment-step.done { border-color: rgba(23,157,132,.28); background: var(--teal-soft); }
.fulfilment-step strong, .fulfilment-step small { display: block; }
.fulfilment-step small { margin-top: 3px; color: var(--muted); font-size: 7.5px; }
@media (max-width: 760px) { .fulfilment-steps { grid-template-columns: repeat(2,minmax(0,1fr)); } }

/* Phase 4 integrations, reporting and downstream reconciliation */
.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.integration-card { padding: 18px; overflow: visible; }
.integration-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.provider-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--navy-2); font-size: 12px; font-weight: 900; letter-spacing: -.03em; }
.provider-ebay { background: linear-gradient(145deg, #366fe0, #7354c5); }
.provider-quickbooks { background: linear-gradient(145deg, #169d73, #087a68); }
.provider-royal_mail { background: linear-gradient(145deg, #c83d48, #a82a33); }
.integration-card h3 { margin: 8px 0 6px; font-size: 14px; }
.integration-card > p { min-height: 40px; margin: 0 0 14px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.integration-details { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin: 12px 0; }
.integration-details > div { padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; }
.integration-details span, .integration-details strong { display: block; }
.integration-details span { color: var(--muted); font-size: 7px; text-transform: uppercase; letter-spacing: .06em; }
.integration-details strong { margin-top: 4px; overflow: hidden; color: var(--ink); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.alert.compact { margin: 8px 0; padding: 9px; font-size: 8px; }
.code-area { min-height: 145px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; }
.mass-balance-list { display: grid; gap: 8px; margin-top: 13px; }
.mass-balance-list > div { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.mass-balance-list span { color: var(--muted); font-size: 8px; }
.mass-balance-list strong { font-size: 10px; }
.mass-balance-list small { grid-column: 1 / -1; color: var(--muted); font-size: 7px; }
.section-title { margin: 9px 0 0; font-size: 15px; }
.report-catalog { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.report-card { min-height: 220px; display: flex; flex-direction: column; padding: 17px; }
.report-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 17px; }
.report-card h3 { margin: 8px 0 5px; font-size: 13px; }
.report-card p { margin: 0; color: var(--muted); font-size: 8.5px; line-height: 1.5; }
.report-card .card-actions { margin-top: auto; padding-top: 15px; }
.check-control { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; font-size: 9px; }
.check-control input { width: 16px; height: 16px; }

@media (max-width: 1180px) {
  .integration-grid, .report-catalog { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .integration-grid, .report-catalog { grid-template-columns: 1fr; }
}
.nav { min-height: 0; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.facility-card { flex: 0 0 auto; }


/* Phase 6 controlled migration, UAT, pilot and go-live */
.phase6-metrics .stat-card { min-height: 118px; }
.go-live-path { display: grid; grid-template-columns: minmax(92px,1fr) 28px minmax(92px,1fr) 28px minmax(92px,1fr) 28px minmax(92px,1fr) 28px minmax(92px,1fr); align-items: center; gap: 8px; margin: 17px 0; padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.path-step { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; padding: 8px; border-radius: 10px; background: #f7f9fc; }
.path-step b { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: #8995a6; background: #e9edf3; font-size: 9px; }
.path-step span, .path-step small { display: block; }
.path-step span { color: var(--ink); font-size: 8.5px; font-weight: 850; }
.path-step small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.path-step.current { background: var(--blue-soft); }
.path-step.current b { color: #fff; background: var(--blue); }
.path-step.done { background: var(--teal-soft); }
.path-step.done b { color: #fff; background: var(--teal); }
.path-link { height: 2px; background: #dfe5ed; }
.phase6-grid { align-items: start; }
.template-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.template-links a { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--blue); background: #fff; font-size: 7px; font-weight: 800; text-decoration: none; }
.progress-wrap { min-width: 120px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e8edf4; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.progress-wrap small { display: block; margin-top: 5px; color: var(--muted); font-size: 7px; }
.mono-wrap { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px !important; }
.error-line { margin: 2px 0; color: #b93643; font-size: 7.5px; }
.wide-cell { min-width: 240px; white-space: normal; line-height: 1.5; }
.readiness-mini { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 14px 0; }
.readiness-mini span { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; color: var(--muted); font-size: 8px; text-align: center; }
.check-warn { color: #9a6700; background: #fff4cf; }
.go-live-gate-card { border-top: 3px solid var(--blue); }

@media (max-width: 1100px) {
  .go-live-path { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .path-link { display: none; }
}
@media (max-width: 760px) {
  .go-live-path { grid-template-columns: 1fr; }
  .phase6-grid { grid-template-columns: 1fr; }
  .readiness-mini { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
