/* LexCorp Vault — visual system in the manner of toshiba-business.com.au
   White space, one red, square corners, bold headlines, red eyebrow labels. */

:root {
  --red: #e61e1e;
  --red-dark: #c41414;
  --red-tint: #fdecec;
  --yellow: #f7c600;
  --blue: #1f6fd6;
  --ink: #222;
  --ink-2: #555;
  --ink-3: #8a8a8a;
  --line: #e2e2e2;
  --bg: #f4f4f4;
  --card: #fff;
  --ok: #1a7f37;
  --ok-bg: #e8f5ec;
  --warn: #9a6700;
  --warn-bg: #fff6d6;
  --font: "ToshibaSans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tap: 48px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); padding-bottom: 72px; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); font-size: 14px; }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

/* Brand stripe + header */
.stripe { height: 4px; background: linear-gradient(90deg, var(--red) 0 60%, var(--yellow) 60% 80%, var(--blue) 80% 100%); }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { max-width: 72rem; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--red); }
.brand .logo { height: 17px; width: auto; display: block; }
.brand .sub { font-size: 12px; color: var(--ink-2); letter-spacing: .12em; text-transform: uppercase; padding-left: 10px; border-left: 1px solid var(--line); line-height: 1; }
.brand:hover { text-decoration: none; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.who .name { color: var(--ink); font-weight: 600; }
.who form { display: inline; }
.link-btn { background: none; border: 0; padding: 0; color: var(--red); font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Desktop nav */
.nav { display: none; gap: 22px; align-items: center; }
.nav a { color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 8px 0; border-bottom: 2px solid transparent; }
.nav a.on { border-color: var(--red); }
.nav a:hover { text-decoration: none; border-color: var(--red); }
@media (min-width: 720px) { .nav { display: flex; } body { padding-bottom: 32px; } .tabs { display: none; } }

/* Mobile bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); min-height: 56px; }
.tabs a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--red); }
.tabs a:hover { text-decoration: none; }

/* Page */
main { max-width: 72rem; margin: 0 auto; padding: 20px 16px 40px; }
main.narrow { max-width: 28rem; }
.eyebrow { color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 6px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin-bottom: 4px; }
.section { margin: 28px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section h2 { font-size: 16px; text-transform: uppercase; letter-spacing: .08em; }
.section a { font-size: 13px; }
.chev::after { content: " ›"; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); padding: 20px; margin-bottom: 14px; }
.card h2 { margin-bottom: 8px; }
.card.flush { padding: 0; }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cols .card { margin: 0; }

/* Tiles (dashboard actions) */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile { display: block; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--red); padding: 16px; color: inherit; min-height: 84px; }
.tile:hover { text-decoration: none; border-color: var(--red); }
.tile strong { display: block; font-size: 16px; margin-bottom: 4px; }
.tile .muted { display: block; }
.tile.primary { background: var(--red); border-color: var(--red); color: #fff; }
.tile.primary .muted { color: rgba(255,255,255,.85); }

/* Stats */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 12px; }
.stat { background: #fff; border: 1px solid var(--line); padding: 14px 16px; color: inherit; display: block; }
.stat .n { display: block; font-size: 34px; font-weight: 800; line-height: 1; color: var(--ink); margin-bottom: 4px; }
.stat .muted { font-size: 13px; }
a.stat:hover { text-decoration: none; border-color: var(--red); }
.stat.warn { border-left: 4px solid var(--yellow); }
.stat.warn .n { color: var(--warn); }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
label.radio, label.check { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
label.radio input, label.check input { margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select {
  width: 100%; min-height: var(--tap); padding: 10px 12px; font: inherit; color: var(--ink);
  border: 1px solid #bdbdbd; border-radius: 0; background: #fff; }
input:focus, select:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
input[inputmode=numeric] { font-size: 24px; letter-spacing: .3em; text-align: center; font-family: var(--mono); }
input.serial { text-transform: uppercase; letter-spacing: .14em; font-family: var(--mono); font-size: 20px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap);
  margin-top: 16px; padding: 10px 20px; font: inherit; font-size: 15px; font-weight: 600; color: #fff;
  background: var(--red); border: 1px solid var(--red); border-radius: 0; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--red-dark); border-color: var(--red-dark); text-decoration: none; }
.btn-block { width: 100%; }
button.quiet, .btn.quiet { background: #fff; color: var(--ink); border-color: #bdbdbd; }
button.quiet:hover, .btn.quiet:hover { background: var(--bg); border-color: var(--ink-2); }
button.danger { background: #fff; color: var(--red); border-color: var(--red); }
button.danger:hover { background: var(--red-tint); }
button.small, .btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; margin: 0; }
button.link { background: none; border: 0; padding: 0; margin: 0; min-height: 0; color: var(--red); font-weight: 500; font-size: inherit; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form select { flex: 1 1 220px; width: auto; }
.inline-form button { margin: 0; }
.filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.filters label { margin-top: 0; }
.filters-actions { display: flex; gap: 8px; }
.filters-actions button, .filters-actions .btn { margin: 0; }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
details > summary { cursor: pointer; font-weight: 600; padding: 10px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details > summary::before { content: "›"; color: var(--red); font-size: 20px; line-height: 1; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
details > summary::-webkit-details-marker { display: none; }

/* Messages */
.alert, .notice, .secret { padding: 12px 14px; margin-bottom: 14px; font-size: 14px; border: 1px solid; border-left-width: 4px; }
.alert { background: var(--red-tint); border-color: #f3b5b0; border-left-color: var(--red); color: #8a1010; }
.alert ul { margin: 0; padding-left: 18px; }
.notice { background: var(--ok-bg); border-color: #b7dfc4; border-left-color: var(--ok); color: var(--ok); }
.secret { background: var(--warn-bg); border-color: #f0d58a; border-left-color: var(--yellow); color: var(--ink); }
.code-big { font-family: var(--mono); font-size: 20px; word-break: break-all; }

/* Serial echo + PIN */
.serial-echo { font-family: var(--mono); font-size: 28px; letter-spacing: .14em; text-align: center; padding: 16px 8px; background: var(--bg); border-left: 4px solid var(--red); word-break: break-all; margin: 8px 0 12px; }
.pin-wrap { text-align: center; padding: 8px 0 4px; }
.pin { font-family: var(--mono); font-size: 56px; font-weight: 700; letter-spacing: .28em; line-height: 1.1; padding-left: .28em; user-select: none; -webkit-user-select: none; }
.pin.old { font-size: 30px; color: var(--ink-2); padding-top: 4px; }
.pin.hidden-pin { color: var(--ink-3); }
.timer { height: 4px; background: var(--line); margin: 12px 0 4px; overflow: hidden; }
.timer > span { display: block; height: 100%; background: var(--red); width: 100%; transition: width 1s linear; }
.pin-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 10px 0 0; }

/* QR + recovery codes */
.qr { display: flex; justify-content: center; padding: 8px; background: #fff; }
.qr svg { width: 220px; height: 220px; }
ol.steps { padding-left: 20px; margin: 8px 0 12px; }
ol.steps li { margin-bottom: 6px; }
ul.codes { columns: 2; padding-left: 0; list-style: none; margin: 8px 0; font-family: var(--mono); font-size: 15px; }
ul.codes li { padding: 3px 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
table.kv th { width: 36%; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-actions form { display: inline; }
.row-actions select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 13px; }

/* Pills */
.pill { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: #ececec; color: var(--ink-2); }
.pill.admin { background: var(--red-tint); color: var(--red); }
.pill.off { background: var(--red-tint); color: var(--red); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }

/* Lists of things */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.list li:last-child { border-bottom: 0; }
.empty { color: var(--ink-3); font-size: 14px; padding: 6px 0; }

.pager nav { display: flex; gap: 14px; margin: 12px 0; }
.foot-links { margin-top: 18px; font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .card { padding: 16px; }
  ul.codes { columns: 1; }
  th.opt, td.opt { display: none; }
}

/* Wide screens: top nav instead of the tab bar (kept last so it wins). */
@media (min-width: 720px) {
  .tabs { display: none; }
  body { padding-bottom: 32px; }
}

/* Barcode scanner (install/serial) */
#reader { width: 100%; background: #000; margin: 8px 0; }
#reader video { width: 100% !important; display: block; }
#reader img[alt="Info icon"], #reader img[alt="Camera based scan"] { display: none; }
#scan-start { margin-top: 0; margin-bottom: 6px; }
