/* Tokens copied from the account portal (ait-portal/src/app/globals.css) so both portals match. */
:root {
  --bg: #0a1122; --panel: #101b33; --panel-2: #0d1730; --panel-3: #16233f;
  --border: #22304f; --border-2: #2a3a5c; --text: #e8eef8; --text-2: #c7d4e8;
  --muted: #8a9cbc; --muted-2: #6f82a6; --cyan: #38bdf8; --blue: #60a5fa; --green: #10b981;
  --amber: #f59e0b; --red: #f87171; --violet: #a78bfa; --on-accent: #04232e; --on-green: #04291b;
  --on-amber: #4e1d1d; --tile: #1b2843; --radius: 14px; --demo: #f59e0b; --on-demo: #05121f;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #eef2f8; --panel: #ffffff; --panel-2: #ffffff; --panel-3: #f5f8fc; --border: #dce3ed; --border-2: #c7d2e1;
    --text: #101a2c; --text-2: #2c3a52; --muted: #556884; --muted-2: #5c6c8a; --cyan: #0284c7; --blue: #0b5fa8;
    --red: #c62828; --violet: #6d28d9; --on-accent: #f2fbff; --tile: #dfe6ef; color-scheme: light;
  }
}
:root[data-theme='light'] {
  --bg: #eef2f8; --panel: #ffffff; --panel-2: #ffffff; --panel-3: #f5f8fc; --border: #dce3ed; --border-2: #c7d2e1;
  --text: #101a2c; --text-2: #2c3a52; --muted: #556884; --muted-2: #5c6c8a; --cyan: #0284c7; --blue: #0b5fa8;
  --red: #c62828; --violet: #6d28d9; --on-accent: #f2fbff; --tile: #dfe6ef; color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--cyan); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 26px; } h2 { font-size: 19px; }
p { margin: 8px 0; }
code { background: var(--panel-3); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.label { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; color: var(--muted-2); text-transform: uppercase; }
.label a { color: inherit; text-decoration: none; } .label a:hover { color: var(--cyan); }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; }
.big { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; } .big.sm { font-size: 20px; } .big.red { color: var(--red); }
.row { display: flex; align-items: center; gap: 12px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; margin: 10px 0; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.grow { flex-grow: 1; min-width: 0; } .nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; gap: 14px; margin-top: 14px; }
.grid.tight { gap: 0 12px; margin-top: 6px; }
@media (min-width: 720px) { .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card.raised { background: var(--panel-3); border-color: var(--border-2); }
.card.flush { padding: 0; overflow: hidden; }
.grid > .card, .split .card + .card { margin: 0; }
.main > .card, .main > a.card { display: block; margin-top: 12px; }
main > .card { margin-top: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--cyan); color: var(--on-accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.secondary { background: var(--panel); border: 1px solid var(--border-2); color: var(--text); }
.btn.wide { width: 100%; margin-top: 6px; }
.btn:disabled, .chip:disabled, .seg button:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-3); border: 1px solid var(--border-2); border-radius: 10px; color: var(--text); cursor: pointer; font-size: 18px; }
.linkbtn { background: none; border: 0; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }
.input { width: 100%; min-height: 44px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 12px; color: var(--text); font: inherit; }
textarea.input { padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--cyan); }
.input:disabled { opacity: .6; }
.input.sm { min-height: 36px; padding: 0 8px; font-size: 13px; width: auto; }
.input.search { max-width: 320px; }
.fl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin: 8px 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--cyan); }
.checks { display: flex; flex-direction: column; }
.pill { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.pill.ok { background: var(--green); color: var(--on-green); } .pill.warn { background: var(--amber); color: var(--on-amber); }
.pill.info { background: var(--cyan); color: var(--on-accent); } .pill.off { background: var(--border); color: var(--text-2); }
.pill.work { background: var(--blue); color: var(--on-accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--panel); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--cyan); border-color: var(--cyan); color: var(--on-accent); font-weight: 700; }
.chip.ghost { border-style: dashed; } a.chip { text-decoration: none; } .chip.danger { color: var(--red); }
.chips { margin: 14px 0 12px; }

/* demo controls */
.demobar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--demo); color: var(--on-demo); padding: 7px 16px; font-size: 13px; font-weight: 600; }
.demobar select { font: inherit; padding: 3px 6px; border-radius: 6px; border: 1px solid #b7791f; background: #fff7e6; color: #05121f; margin-left: 6px; }
.demobar .sw { display: flex; align-items: center; gap: 6px; } .demobar .sw input { width: 16px; height: 16px; }

/* staff console layout, same as the account portal's admin shell */
.admin { display: flex; min-height: calc(100vh - 38px); align-items: stretch; }
.admin > nav.side { width: 250px; flex-shrink: 0; background: var(--panel-2); border-right: 1px solid var(--border); padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 14px; }
.brand img { height: 28px; width: auto; }
.product { font-weight: 800; letter-spacing: .02em; color: var(--cyan); border-left: 1px solid var(--border-2); padding-left: 10px; }
img.logo-light { display: none; }
:root[data-theme='light'] img.logo-dark { display: none; } :root[data-theme='light'] img.logo-light { display: block; }
@media (prefers-color-scheme: light) { :root:not([data-theme='dark']) img.logo-dark { display: none; } :root:not([data-theme='dark']) img.logo-light { display: block; } }
.tenant { background: var(--panel-3); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.tname { font-weight: 700; font-size: 14px; } .tenant .muted { font-size: 12px; }
nav.side a.nav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 14px; }
nav.side a.nav:hover { color: var(--text); }
nav.side a.nav.on { color: var(--cyan); font-weight: 700; background: var(--panel-3); }
.navsep { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); margin: 16px 12px 6px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic.big { width: 40px; height: 40px; color: var(--muted); }
.col { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
header.bar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.who { text-align: right; line-height: 1.25; } .who .nm { font-size: 13px; font-weight: 600; } .who .muted { font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cyan); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.offline-banner { display: flex; gap: 10px; align-items: center; background: color-mix(in srgb, var(--amber) 18%, var(--panel)); border-bottom: 1px solid var(--amber); padding: 10px 24px; font-size: 14px; }
main#main { padding: 24px 28px 60px; outline: none; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.pagehead.tight h1 { font-size: 22px; }
.sechead { margin: 24px 0 4px; font-size: 16px; }
.split { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }
.split > .rail { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 1100px) { .split { flex-direction: row; align-items: flex-start; } .split > .main { flex-grow: 1; min-width: 0; } .split > .rail { width: 330px; flex-shrink: 0; } }
.today h2 { margin: 4px 0; }
.stats .card { min-height: 112px; }
a.card.prow { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }
a.card.prow:hover { border-color: var(--border-2); background: var(--panel-3); }
.prow .num { font-size: 13px; color: var(--muted); } .prow .num b { font-size: 20px; color: var(--text); }
.pbar { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; display: flex; margin-top: 8px; }
.pbar span { display: block; height: 100%; } .pbar .p { background: var(--green); } .pbar .f { background: var(--red); } .pbar .w { background: var(--blue); }
.feed { list-style: none; padding: 0; margin: 8px 0; } .feed li { padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; } .feed li:first-child { border-top: 0; }
.denied { text-align: center; padding: 48px 20px; max-width: 560px; margin: 40px auto; }
.person { padding: 8px 0; border-top: 1px solid var(--border); } .person:first-of-type { border-top: 0; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); padding: 12px 14px; background: var(--panel-3); border-bottom: 1px solid var(--border); }
.tbl td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.tbl tr[data-href] { cursor: pointer; } .tbl tr[data-href]:hover td { background: var(--panel-3); }
.scrollx { overflow-x: auto; }
.matrix th { text-align: center; min-width: 110px; } .matrix th:first-child { text-align: left; min-width: 280px; }
.matrix td.c { text-align: center; } .matrix input { width: 18px; height: 18px; accent-color: var(--cyan); cursor: pointer; }
.matrix tr.grp td { background: var(--panel-2); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cyan); padding: 8px 14px; }

/* project detail */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 10px; }
.thumb { display: block; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--text-2); font-size: 12px; background: #fff; }
.thumb img { display: block; width: 100%; } .thumb span { display: block; padding: 6px 10px; background: var(--panel-3); }

/* field app */
.field { display: grid; gap: 14px; margin-top: 12px; }
@media (min-width: 1100px) { .field { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; } }
.maptools { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.legend { font-size: 12px; color: var(--muted); } .legend .d { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 10px; border: 1px solid var(--muted-2); vertical-align: -1px; }
.d.none { background: #fff; } .d.partial { background: #2563eb; } .d.pass { background: #16a34a; } .d.fail { background: #dc2626; }
.mapscroll { overflow: auto; max-height: 78vh; background: #6b6f74; padding: 10px; }
.mapwrap { position: relative; } .mapwrap img { display: block; width: 100%; }
.mk { position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; padding: 0; border: 3px solid #eab308;
  background: #fff; color: #101a2c; font: 700 10px/1 'Fira Sans', sans-serif; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.mk.ring-g { border-color: #22c55e; } .mk.st-partial { background: #2563eb; color: #fff; } .mk.st-pass { background: #16a34a; color: #fff; } .mk.st-fail { background: #dc2626; color: #fff; }
.mk.sel { outline: 3px solid #0a1122; outline-offset: 2px; z-index: 2; }
.devpanel .devname { font-size: 18px; font-weight: 600; word-break: break-all; }
.devpanel .empty { padding: 20px 0; }
.scanrow { margin: 4px 0 8px; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-left: 1px solid var(--border-2); background: var(--panel); color: var(--text-2); font: inherit; font-size: 13px; padding: 8px 14px; cursor: pointer; min-height: 38px; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--cyan); color: var(--on-accent); font-weight: 700; }
.seg button.on.pass { background: var(--green); color: var(--on-green); } .seg button.on.fail { background: #dc2626; color: #fff; }
.labelbox { border: 1px dashed var(--border-2); border-radius: 12px; padding: 12px; margin-top: 10px; }
.labelsvg { width: 100%; background: #fff; border-radius: 6px; display: block; margin-bottom: 10px; }

/* labels page */
.preview-name { background: var(--panel-3); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.plan.current { border-color: var(--cyan); } .plan ul { padding-left: 18px; }
.steps-list { padding-left: 18px; } .steps-list li { margin: 6px 0; }
.conflict { margin-top: 14px; }
.pick { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.pick.chosen { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.minilogo { height: 26px; }

/* sign-in */
.signin { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.sbox { width: 100%; max-width: 400px; } .sbox img { height: 32px; } .sbox h1 { margin-top: 14px; }

/* modal + toast */
dialog#modal { border: 1px solid var(--border-2); border-radius: 16px; background: var(--panel); color: var(--text); padding: 0; width: min(560px, calc(100vw - 32px)); }
dialog#modal::backdrop { background: rgba(3, 8, 20, .6); }
.mbox { padding: 22px 24px; } .mbody { margin-top: 12px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; } .steps span { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--panel-3); color: var(--muted); }
.steps span.on { background: var(--cyan); color: var(--on-accent); font-weight: 700; }
.drop { border: 2px dashed var(--border-2); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); margin: 10px 0; font-size: 14px; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--panel-3);
  border: 1px solid var(--border-2); color: var(--text); padding: 11px 18px; border-radius: 12px; transition: .2s; z-index: 50; max-width: 92vw; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { border-color: var(--green); } #toast.warn { border-color: var(--amber); }

@media (max-width: 820px) {
  .admin { flex-direction: column; }
  .admin > nav.side { width: auto; border-right: 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px; }
  .brand, .tenant { width: 100%; } .navsep { display: none; }
  nav.side a.nav span { font-size: 13px; }
  main#main { padding: 18px 16px 48px; } header.bar { padding: 10px 16px; } .who { display: none; }
  .tbl { font-size: 13px; } .card.flush { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
.seg.wide { display: flex; margin: 10px 0 4px; } .seg.wide button { flex: 1; }
.dlist { border: 1px solid var(--border); border-radius: 10px; padding: 4px 12px; max-height: 220px; overflow: auto; margin: 6px 0 10px; }
.drow { border-top: 1px solid var(--border); padding: 4px 0; } .drow:first-child { border-top: 0; }
.portalprev { background: #0a1122; color: #e8eef8; border-radius: 12px; padding: 14px; border: 1px solid #22304f; }
.portalprev .pdf { width: 38px; height: 46px; border-radius: 6px; background: rgba(96,165,250,.15); border: 1px solid rgba(96,165,250,.5); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #93c5fd; flex-shrink: 0; }
.portalprev .muted { color: #8a9cbc; }
.pubok { margin-top: 12px; border-color: var(--green); font-size: 14px; }
.warnline { background: color-mix(in srgb, var(--amber) 16%, var(--panel)); border: 1px solid var(--amber); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.signout { min-height: 36px; padding: 0 12px; font-size: 13px; }
/* printing: only the label strips */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  body { background: #fff; }
  #print-area { display: block; }
  .pg { overflow: hidden; page-break-after: always; break-after: page; }
  .pg:last-child { page-break-after: auto; break-after: auto; }
  .pg svg { display: block; }
}
.labelprev svg { width: 100%; height: auto; background: #fff; border-radius: 6px; display: block; margin-bottom: 10px; }
