/* NPI InvHub - styled like the NPI ESS Portal ("Bold Brand": charcoal #18181B + red #DC2626,
   Source Sans 3 for text, Barlow Semi Condensed for headings, square corners). */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@500;600;700&family=Source+Sans+3:wght@400;500;600;700;800&display=swap');

:root {
  --brand: #dc2626; --brand-2: #b91c1c; --brand-soft: #fef2f2; --brand-ink: #b91c1c;
  --charcoal: #18181b; --zinc-800: #27272a; --zinc-700: #3f3f46; --zinc-600: #52525b;
  --bg: #f4f4f5; --panel: #ffffff; --ink: #18181b; --ink-2: #3f3f46; --muted: #71717a; --line: #e4e4e7; --line-2: #d4d4d8;
  --err: #b91c1c; --err-soft: #fee2e2; --warn: #b45309; --warn-soft: #fef3c7; --ok: #047857; --ok-soft: #d1fae5;
  --hol: #6d28d9; --hol-soft: #ede9fe; --off: #52525b; --off-soft: #e4e4e7;
  --radius: 5px; --shadow: 0 1px 2px rgba(24, 24, 27, .06), 0 1px 3px rgba(24, 24, 27, .08);
  --font: 'Source Sans 3', ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
  --display: 'Barlow Semi Condensed', 'Source Sans 3', ui-sans-serif, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 15px/1.45 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
::selection { background: var(--brand); color: #fff; }
h1, h2, h3 { font-family: var(--display); letter-spacing: .01em; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.2rem; margin: 0 0 .8rem; text-transform: uppercase; letter-spacing: .03em; }
h3 { font-size: 1.05rem; margin: 0 0 .6rem; text-transform: uppercase; letter-spacing: .03em; }
a { color: var(--brand-2); }
small { font-size: .8rem; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .block { display: block; } .right { text-align: right; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.boot, .loading-page { padding: 3rem; text-align: center; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }

/* ---- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .95rem; border-radius: 4px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--ink); font: 600 .9rem var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 38px; }
.btn:hover { border-color: var(--charcoal); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, .cal-cell:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .95rem; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger { color: var(--err); border-color: #fca5a5; }
.btn.primary.danger { background: var(--err); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .65rem; min-height: 32px; font-size: .82rem; }
.btn.small.primary { font-size: .85rem; }
.btn.block { width: 100%; }
.btn.link { border: 0; background: none; color: var(--brand-2); padding: .4rem 0; }
.btn:disabled, .btn.loading { opacity: .5; cursor: default; }
.btn.loading::after { content: ''; width: .8em; height: .8em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 4px; cursor: pointer; font-size: 1rem; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.link-btn { border: 0; background: none; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.link-btn:hover:not(:disabled) { text-decoration: underline; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--ink); background: #fafafa; border: 1px solid var(--line-2); border-radius: 4px; padding: .5rem .65rem; min-height: 38px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(220, 38, 38, .25); background: #fff; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
textarea { resize: vertical; }
input:disabled, select:disabled { background: var(--bg); color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field > span { font-size: .72rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.field.grow { flex: 1; }
.check { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem 1rem; }
.span2 { grid-column: 1 / -1; }
.actions { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; margin-top: 1rem; flex-wrap: wrap; }

/* ---- ESS header: charcoal top bar + red module bar */
.nx-wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.nx-header { position: sticky; top: 0; z-index: 40; color: #fff; box-shadow: 0 6px 16px rgba(24, 24, 27, .18); }
.nx-top { background: var(--charcoal); }
.nx-top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 10px; padding-bottom: 10px; }
.nx-brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; min-width: 0; }
.nx-logo { display: inline-flex; flex: none; background: #fff; border-radius: 8px; padding: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.nx-logo svg { width: 100%; height: 100%; }
.nx-brand-text { display: flex; align-items: baseline; gap: .75rem; line-height: 1.1; min-width: 0; }
.nx-name { font-family: var(--display); font-weight: 700; font-size: 23px; letter-spacing: .08em; }
.nx-name.big { font-size: 28px; }
.nx-sub { font-size: 11px; color: #d4d4d8; letter-spacing: .16em; white-space: nowrap; }
.nx-top-right { display: flex; align-items: center; gap: .6rem; }
.nx-module-select { display: none; width: auto; background: var(--charcoal); color: #fff; border: 1px solid var(--zinc-600); font-weight: 600; height: 40px; }
.nx-user { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--zinc-600); border-radius: 4px; padding: 4px 6px 4px 4px; }
.nx-avatar { width: 36px; height: 36px; border-radius: 3px; background: #fff; color: var(--charcoal); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; }
.nx-user-text { display: flex; flex-direction: column; line-height: 1.15; }
.nx-user-text strong { font-size: .88rem; font-weight: 600; }
.nx-user-text small { font-size: 11px; color: #d4d4d8; }
.nx-logout { border: 0; background: none; color: #d4d4d8; padding: 8px; border-radius: 4px; cursor: pointer; display: flex; }
.nx-logout:hover { background: var(--zinc-700); color: #fff; }
.nx-bar { background: var(--brand); }
.nx-modules { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 48px; }
.nx-modules a { display: flex; align-items: center; padding: 0 16px; color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap; }
.nx-modules a:hover { background: var(--brand-2); }
.nx-modules a.active { background: var(--charcoal); font-weight: 700; padding: 0 24px; clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.nx-app { min-height: 100vh; display: flex; flex-direction: column; }
.nx-main { flex: 1; }
.content { max-width: 1280px; margin: 0 auto; padding: 28px 24px 48px; outline: none; }
.nx-footer { background: var(--charcoal); border-top: 4px solid var(--brand); color: #a1a1aa; font-size: 12px; padding: 18px 0; margin-top: auto; }
.nx-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.nx-footer-row p { margin: 0; font-size: 11px; color: #71717a; }
.nx-footer-brand { display: flex; align-items: center; gap: .6rem; }
.nx-footer-brand .nx-logo { border-radius: 4px; padding: 2px; }
.nx-footer-pill { background: var(--zinc-800); border: 1px solid var(--zinc-700); color: #e4e4e7; padding: 3px 12px; border-radius: 99px; font-weight: 500; letter-spacing: .02em; }

/* ---- ESS module heading (uppercase display title, charcoal rule) */
.page-head { display: flex; align-items: flex-end; gap: .8rem 1.2rem; flex-wrap: wrap; margin-bottom: 1.4rem; padding-bottom: .9rem; border-bottom: 2px solid var(--charcoal); }
.page-head h1 { margin-right: auto; font-size: 34px; line-height: 1.05; font-weight: 700; text-transform: uppercase; color: var(--charcoal); }
.page-head > div:first-child { margin-right: auto; }
.page-head > div:first-child h1 { margin: 0; }
.page-head p.muted { margin: .3rem 0 0; }
.ph-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ph-icon { color: var(--brand); margin-right: .5rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.25rem; margin-bottom: 1rem; }
.form-card { max-width: 880px; }
.error-card { border-color: var(--err); border-top: 3px solid var(--err); }
.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.toolbar input[type=search] { max-width: 340px; }
.filters { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { min-width: 150px; }
.tabs { display: flex; gap: 1.5rem; border-bottom: 2px solid var(--line); margin: -.6rem 0 1.2rem; overflow-x: auto; }
.tabs a { padding: .35rem 0 .6rem; color: var(--zinc-600); text-decoration: none; font-weight: 600; font-size: 15px; border-bottom: 4px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a:hover { color: var(--charcoal); border-bottom-color: var(--line-2); }
.tabs a.active { color: var(--brand-2); border-bottom-color: var(--brand); font-weight: 700; }

/* ---- ESS sign-in page */
.nx-login { position: fixed; inset: 0; z-index: 50; background: var(--brand); overflow-y: auto; }
.nx-login-bg { position: fixed; inset: 0; pointer-events: none; }
.nx-login-bg svg { width: 100%; height: 100%; display: block; }
.nx-login-bottom { position: fixed; left: 0; right: 0; bottom: 0; height: 10px; background: var(--charcoal); pointer-events: none; }
.nx-login-inner { position: relative; min-height: 100%; max-width: 1280px; margin: 0 auto; padding: 48px 64px; display: flex; align-items: center; gap: 48px; }
.nx-login-left { flex: 1; align-self: stretch; display: flex; flex-direction: column; color: #fff; }
.nx-login-left .nx-sub { color: #e4e4e7; letter-spacing: .18em; }
.nx-login-left .nx-brand-text { flex-direction: column; align-items: flex-start; gap: 2px; }
.nx-login-hero { margin-top: auto; padding-top: 64px; }
.nx-login-hero h1 { font-size: 76px; line-height: .98; text-transform: uppercase; font-weight: 700; letter-spacing: 0; }
.nx-login-hero p { font-size: 1.15rem; line-height: 1.6; max-width: 28rem; margin-top: 1.2rem; }
.nx-login-card { width: 480px; flex: none; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 30px 70px rgba(24, 24, 27, .4); }
.nx-card-head { background: var(--charcoal); color: #fff; padding: 24px 32px; }
.nx-card-head h2 { font-size: 28px; margin: 0; letter-spacing: .04em; }
.nx-card-head p { margin: 2px 0 0; font-size: .88rem; color: #d4d4d8; }
.nx-card-body { padding: 32px; display: flex; flex-direction: column; gap: 1.2rem; }
.nx-card-foot { border-top: 1px solid var(--line); background: #fafafa; padding: 12px; text-align: center; font-size: 12px; color: var(--muted); }
.nx-form { display: flex; flex-direction: column; gap: 1.3rem; }
.nx-label { display: block; font-size: .72rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5rem; }
.nx-email { display: flex; }
.nx-input { padding: .75rem .85rem; font-weight: 500; }
.nx-input-left { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; flex: 1; min-width: 0; }
.nx-domain { width: auto; max-width: 55%; flex: none; border-top-left-radius: 0; border-bottom-left-radius: 0; background: var(--bg); font-weight: 600; font-size: .88rem; }
.nx-hint { font-size: 11.5px; color: var(--muted); margin: .45rem 0 0; }
.nx-hint strong { color: var(--ink-2); }
.nx-primary { width: 100%; padding: .85rem; background: var(--brand); color: #fff; border: 0; border-radius: 4px; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.nx-primary:hover { background: var(--brand-2); }
.nx-primary:disabled { opacity: .5; }
.nx-alert { padding: .7rem .85rem; border-radius: 5px; background: var(--err-soft); border: 1px solid #fecaca; color: var(--err); font-size: .82rem; font-weight: 600; white-space: pre-line; }
.nx-alert.info { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.nx-otp-head { text-align: center; }
.nx-otp-head h3 { text-transform: none; font-family: var(--font); font-size: 1.1rem; font-weight: 700; margin: 0; }
.nx-otp-head p { font-size: .8rem; color: var(--muted); margin: .3rem 0 0; }
.nx-key { width: 48px; height: 48px; border-radius: 50%; background: var(--err-soft); display: flex; align-items: center; justify-content: center; margin: 0 auto .7rem; font-size: 1.3rem; }
.nx-otp-row { display: flex; justify-content: center; gap: .5rem; }
.nx-otp { width: 46px; height: 54px; text-align: center; font: 700 1.3rem ui-monospace, monospace; padding: 0; border-radius: 6px; }
.nx-otp-links { display: flex; justify-content: space-between; font-size: .8rem; }
.nx-otp-links button { border: 0; background: none; cursor: pointer; color: var(--muted); font: inherit; font-weight: 600; }
.nx-otp-links .nx-link-red { color: var(--brand); }

/* ---- home */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.tile { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--charcoal); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.tile:hover { border-top-color: var(--brand); }
.tile-label { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.tile-value { font-family: var(--display); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.tile-value .badge { font-family: var(--font); font-size: .85rem; }
.tile-action { color: var(--brand-2); font-size: .82rem; font-weight: 700; margin-top: auto; }
.visit-list { list-style: none; margin: 0; padding: 0; }
.visit-list li { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.visit-list li:first-child { border-top: 0; }
.visit-list li > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.visit-time { width: 76px; font-weight: 700; display: flex; flex-direction: column; color: var(--brand-2); }
.visit-time small { color: var(--muted); font-weight: 400; }
.visit-actions { display: flex; gap: .4rem; }

/* ---- badges, alerts, toasts */
.badge { display: inline-block; padding: .14rem .5rem; border-radius: 3px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: var(--off-soft); color: var(--off); white-space: nowrap; }
.b-pending, .b-draft, .b-notstarted, .b-saved { background: var(--warn-soft); color: var(--warn); }
.b-encoding, .b-submitted, .b-created, .b-pendingsync { background: #dbeafe; color: #1d4ed8; }
.b-encoded, .b-approved, .b-active, .b-synced { background: var(--ok-soft); color: var(--ok); }
.b-cancelled, .b-returned, .b-inactive, .b-reopened, .b-conflict { background: var(--err-soft); color: var(--err); }
.b-admin { background: var(--charcoal); color: #fff; } .b-management { background: var(--brand); color: #fff; }
.b-field { background: var(--off-soft); color: var(--ink); } .b-encoder { background: #dbeafe; color: #1d4ed8; } .b-supervisor { background: var(--warn-soft); color: var(--warn); }
.b-offline { background: var(--charcoal); color: #fff; }
.rights { display: flex; gap: .25rem; flex-wrap: wrap; }
.alert { padding: .7rem .9rem; border-radius: 8px; background: var(--off-soft); margin-bottom: .8rem; }
.alert.warn { background: var(--warn-soft); color: var(--warn); } .alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); } .alert.hol { background: var(--hol-soft); color: var(--hol); }
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 460px); }
.toast { padding: .75rem 1rem; border-radius: 5px; background: var(--charcoal); border-left: 4px solid var(--brand); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); white-space: pre-line; transition: opacity .5s, transform .5s; }
.toast.err { background: #991b1b; }
.toast.hide { opacity: 0; transform: translateY(8px); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty-icon { font-size: 1.6rem; opacity: .5; }
.unsaved { color: var(--warn); font-weight: 600; font-size: .8rem; }
.note { color: var(--err); }
.c-err { color: var(--err); font-weight: 600; } .c-warn { color: var(--warn); font-weight: 600; } .c-ok { color: var(--ok); font-weight: 600; }

/* ---- tables */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: .72rem; background: #fafafa !important; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: .55rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
.grid td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tr.clickable { cursor: pointer; }
.grid tr.clickable:hover td { background: var(--brand-soft); }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.report { max-height: 65vh; }
.report td { white-space: nowrap; }
.r-missed, .r-expired { color: var(--err); font-weight: 600; } .r-partial, .r-within30days { color: var(--warn); font-weight: 600; } .r-complete { color: var(--ok); font-weight: 600; }

/* ---- modal */
.modal-back { position: fixed; inset: 0; background: rgba(24, 24, 27, .55); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem 1rem; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 5px; overflow: hidden; width: 100%; max-width: 480px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.1rem; background: var(--charcoal); color: #fff; }
.modal-head .icon-btn { color: #d4d4d8; } .modal-head .icon-btn:hover { background: var(--zinc-700); color: #fff; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 1.1rem; }
.modal-body form > .field, .modal-body form > label { margin-bottom: .8rem; }
.issues { margin: .4rem 0; padding-left: 1.1rem; }
.issues li { margin: .25rem 0; }
.issues li.err { color: var(--err); } .issues li.warn { color: var(--warn); }

/* ---- uploads */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; padding: 1.6rem 1rem; border: 2px dashed var(--line-2); border-radius: 5px; background: #fafafa; cursor: pointer; margin: 1rem 0 .6rem; text-align: center; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.file-list { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }
.file-chip { padding: .4rem .6rem; background: var(--bg); border-radius: 8px; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: .6rem 0; }
.progress-fill { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.pic-item { position: relative; display: flex; flex-direction: column; gap: .3rem; }
.pic-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--bg); }
.pic-item select, .pic-item input { font-size: .8rem; min-height: 32px; padding: .3rem .4rem; }
.pic-del { position: absolute; top: 4px; right: 4px; background: rgba(15, 23, 42, .65); color: #fff; }
.post-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.thumb { position: relative; padding: 0; border: 0; background: none; cursor: zoom-in; width: 140px; }
.thumb img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; display: block; background: var(--bg); }
.thumb span { position: absolute; left: 4px; bottom: 4px; background: rgba(15, 23, 42, .7); color: #fff; font-size: .7rem; padding: .1rem .35rem; border-radius: 5px; }
.viewer { margin: 0; } .viewer img { width: 100%; border-radius: 8px; } .viewer figcaption { color: var(--muted); margin-top: .4rem; }

/* ---- MCP calendar */
.month-nav { display: flex; align-items: center; gap: .6rem; }
.month-nav strong { min-width: 9.5rem; text-align: center; font-size: 1.05rem; }
.head-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.plan-status { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin: -.3rem 0 .8rem; }
.mcp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.cal-card { padding: .6rem; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: .74rem; font-weight: 700; color: #fff; background: var(--charcoal); padding: .35rem 0; text-transform: uppercase; letter-spacing: .08em; border-radius: 2px; }
.cal-wd.rest { background: var(--zinc-600); }
.cal-cell { min-height: 112px; display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: left; padding: .35rem; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; overflow: hidden; }
.cal-cell:hover { border-color: var(--charcoal); }
.cal-cell.pad { background: transparent; border-style: dashed; opacity: .4; cursor: default; }
.cal-cell.rest { background: #f4f4f5; }
.cal-cell.holiday { background: var(--hol-soft); }
.cal-cell.dayoff { background: repeating-linear-gradient(135deg, var(--off-soft) 0 6px, var(--panel) 6px 12px); }
.cal-cell.has-err { border-color: var(--err); box-shadow: inset 0 0 0 1px var(--err); }
.cal-cell.has-warn { border-color: var(--warn); }
.cal-cell.today .cal-date span:first-child { background: var(--charcoal); color: #fff; border-radius: 2px; padding: 0 .4rem; }
.cal-date { display: flex; justify-content: space-between; font-family: var(--display); font-weight: 700; font-size: 1rem; }
.dot { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; font-size: .68rem; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.dot.err { background: var(--err); } .dot.warn { background: var(--warn); }
.tag { font-size: .68rem; font-weight: 600; border-radius: 4px; padding: .05rem .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-hol { background: var(--hol); color: #fff; } .tag-off { background: var(--off); color: #fff; }
.chip { font-size: .74rem; background: #f4f4f5; color: var(--ink); border-left: 3px solid var(--charcoal); border-radius: 2px; padding: .08rem .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip b { font-weight: 700; }
.more { font-size: .7rem; color: var(--muted); }
.mcp-side .card { padding: .9rem 1rem; }
.check-sum { display: flex; gap: .8rem; margin-bottom: .4rem; }
.mcp-side .issues { max-height: 340px; overflow-y: auto; font-size: .82rem; }
.store-sum { list-style: none; padding: 0; margin: 0; }
.store-sum li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--line); }
.store-sum li:first-child { border-top: 0; }
.legend div { display: flex; align-items: center; gap: .5rem; font-size: .8rem; margin: .25rem 0; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line-2); }
.sw-hol { background: var(--hol-soft); } .sw-off { background: repeating-linear-gradient(135deg, var(--off-soft) 0 3px, var(--panel) 3px 6px); }
.sw-rest { background: var(--off-soft); } .sw-err { border: 2px solid var(--err); }
.day-editor .visit-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px 36px; gap: .5rem; align-items: end; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.day-visits { margin: .6rem 0; }
.day-editor > input { margin: .2rem 0 .6rem; }

/* ---- encoding */
.enc-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.pdf-pane { padding: 0; overflow: hidden; position: sticky; top: 130px; }
.pdf-pane iframe { width: 100%; height: calc(100vh - 190px); border: 0; display: block; background: #525659; }
.enc-info { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; margin-bottom: 1rem; }
.kv { display: flex; flex-direction: column; gap: .1rem; }
.kv > span:first-child { font-size: .7rem; text-transform: uppercase; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.kv .badge { align-self: flex-start; margin-top: .2rem; }
.line-head, .line-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 92px 148px 32px; gap: .4rem; align-items: start; }
.line-head { font-size: .72rem; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.line-row { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.line-row.bad input[list] { border-color: var(--err); }
.line-no { color: var(--muted); padding-top: .55rem; font-size: .8rem; text-align: right; }
.sku-desc { display: block; color: var(--muted); margin-top: .15rem; min-height: 1em; }
.sku-desc.bad { color: var(--err); }
.enc-lines .btn { margin-top: .6rem; }
.enc-totals { display: flex; gap: 1rem; justify-content: flex-end; font-weight: 600; margin-top: .6rem; }
.enc-log-wrap { margin-top: 1rem; } .enc-log-wrap summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }

/* ---- admin */
.picker { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; }
.suggest:empty { display: none; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .5rem .7rem; cursor: pointer; color: var(--ink); font: inherit; }
.suggest button:hover { background: var(--bg); }
.rights-box { border: 1px solid var(--line); border-radius: 8px; padding: .4rem .8rem .6rem; margin: 0 0 .8rem; }

/* ---- small screens */
@media (max-width: 1100px) {
  .mcp-layout, .enc-layout { grid-template-columns: 1fr; }
  .pdf-pane { position: static; } .pdf-pane iframe { height: 60vh; }
}
@media (max-width: 1023px) {
  .nx-modules { display: none; }
  .nx-bar { height: 6px; }
  .nx-module-select { display: block; }
  .nx-user-text { display: none; }
  .nx-login-inner { flex-direction: column; align-items: stretch; padding: 32px 16px; gap: 28px; }
  .nx-login-hero { padding-top: 20px; margin-top: 0; }
  .nx-login-hero h1 { font-size: 34px; }
  .nx-login-hero p { display: none; }
  .nx-login-card { width: 100%; max-width: 520px; margin: 0 auto; }
}
@media (max-width: 760px) {
  .nx-wrap { padding: 0 16px; }
  .nx-sub { display: none; }
  .nx-name { font-size: 20px; }
  .content { padding: 18px 16px 40px; }
  .page-head h1 { font-size: 26px; }
  .nx-card-body { padding: 22px 18px; }
  .nx-card-head { padding: 18px; }
  .nx-otp { width: 40px; height: 48px; }
  .cal-cell { min-height: 64px; padding: .25rem; }
  .cal-date { font-size: .85rem; }
  .chip { font-size: 0; padding: 0; height: 6px; border-radius: 1px; border-left: 0; background: var(--charcoal); }
  .tag { font-size: 0; height: 4px; padding: 0; }
  .more { font-size: .62rem; }
  .day-editor .visit-row { grid-template-columns: 1fr 1fr 36px; }
  .day-editor .visit-row .field.grow { grid-column: 1 / -1; }
  .enc-info { grid-template-columns: 1fr; }
  .line-head { display: none; }
  .line-row { grid-template-columns: 24px 1fr 1fr 32px; }
  .line-row > div { grid-column: 2 / 4; }
  .visit-list li { flex-wrap: wrap; }
}

/* problem list in the MCP side panel: no bullets, coloured left rule */
.mcp-side .issues, .day-editor .issues { list-style: none; padding-left: 0; }
.mcp-side .issues li, .day-editor .issues li { border-left: 3px solid currentColor; padding: .15rem 0 .15rem .55rem; }

/* phones: logo only in the header so the module menu fits; 2 home tiles per row */
@media (max-width: 520px) {
  .nx-top .nx-brand-text { display: none; }
  .nx-top-right { flex: 1; justify-content: flex-end; min-width: 0; }
  .nx-module-select { flex: 1; min-width: 0; max-width: 220px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .tile { padding: .8rem; }
  .tile-value { font-size: 1.6rem; }
}
