/* HbPRISM Ocular console. One stylesheet. Left menu on a desktop, top drawer on a phone. */
@font-face { font-family: Inter; src: url(/static/fonts/Inter-Regular.ttf); font-weight: 400; }
@font-face { font-family: Inter; src: url(/static/fonts/Inter-SemiBold.ttf); font-weight: 600; }
@font-face { font-family: Inter; src: url(/static/fonts/Inter-Bold.ttf); font-weight: 700; }
:root {
  --bg: #f4f6f8; --card: #fff; --ink: #17202a; --muted: #5b6472; --line: #e1e5ea;
  --accent: #0d5c73; --accent-2: #0a4a5d; --head: #10212b; --head-ink: #c9d8de;
  --ok: #1e7a3c; --ok-bg: #e5f4e4; --warn: #8a5a00; --warn-bg: #faefd9;
  --bad: #a3262a; --bad-bg: #fbebeb; --info: #1d5a96; --info-bg: #e7f1fb; --radius: 10px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 2px; letter-spacing: -.2px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 14px 0 6px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; letter-spacing: .3px; }
.id { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .5px; }

.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
nav.side { background: var(--head); color: var(--head-ink); padding: 14px 10px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; padding: 4px 8px 14px; }
.brand img { width: 30px; height: 30px; background: #fff; border-radius: 50%; padding: 2px; }
.brand small { display: block; font-weight: 400; color: #8fa9b5; font-size: .74rem; }
.brand:hover { text-decoration: none; }
nav.side h4 { font-size: .68rem; text-transform: uppercase; letter-spacing: .9px; color: #7d97a3; margin: 14px 10px 4px; font-weight: 600; }
nav.side a.item { display: block; padding: 7px 10px; border-radius: 7px; color: var(--head-ink); font-size: .93rem; }
nav.side a.item:hover { background: #1a3340; color: #fff; text-decoration: none; }
nav.side a.item.on { background: #1f4252; color: #fff; font-weight: 600; }
.me { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid #22404d; font-size: .85rem; }
.me b { color: #fff; display: block; } .me a { color: #9fc4d1; }
.me button { background: none; border: 1px solid #47606c; color: var(--head-ink); padding: 4px 10px; border-radius: 6px; margin-top: 8px; font: inherit; font-size: .82rem; cursor: pointer; }
main { padding: 22px 28px 60px; max-width: 1240px; width: 100%; }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.card.tight { padding: 0; overflow: hidden; } .card.tight > h2 { padding: 14px 18px 0; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.15; letter-spacing: -.5px; } .stat span { color: var(--muted); font-size: .85rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; } tbody tr:hover td { background: #fafcfd; }
.empty { padding: 22px; text-align: center; color: var(--muted); }

.tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eceff3; color: #3c4654; white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); } .tag.info { background: var(--info-bg); color: var(--info); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--ok-bg); color: #14532a; border: 1px solid #bfe3c2; }
.flash.bad { background: var(--bad-bg); color: #7c1d20; border-color: #f0c4c5; }
.note { padding: 10px 14px; border-radius: 8px; background: var(--info-bg); color: #173f6b; margin-bottom: 14px; font-size: .92rem; }
.note.warn { background: var(--warn-bg); color: #6b4500; }

label { display: block; font-size: .82rem; font-weight: 600; color: #3c4654; margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c9d0d8; border-radius: 7px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #8cc4d4; outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; } .row > * { flex: 1; min-width: 130px; } .row > .fit { flex: 0 0 auto; min-width: 0; }
.check { display: flex; align-items: center; gap: 7px; font-weight: 400; font-size: .92rem; color: var(--ink); margin: 6px 0; } .check input { width: auto; }
button, .btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 7px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
button:hover, .btn:hover { background: var(--accent-2); text-decoration: none; }
button.ghost, .btn.ghost { background: #fff; color: var(--accent); border: 1px solid #b9c7ce; }
button.ghost:hover, .btn.ghost:hover { background: #f1f6f8; }
button.bad { background: var(--bad); } button.small, .btn.small { padding: 4px 10px; font-size: .84rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
details.more { margin-top: 10px; } details.more > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 5px 14px; margin: 0; } .kv dt { color: var(--muted); font-size: .88rem; } .kv dd { margin: 0; }
.bar { height: 8px; background: #e6eaef; border-radius: 99px; overflow: hidden; min-width: 90px; } .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.list a.line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--ink); }
.list a.line:hover { background: #f7fafb; text-decoration: none; } .list a.line span:last-child { color: var(--accent); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.photo { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.photo .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.photo .pair.one { grid-template-columns: 1fr; }
.photo figure { margin: 0; background: #0e151a; position: relative; aspect-ratio: 4/3; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo figcaption { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.62); color: #fff; font-size: .7rem; padding: 1px 7px; border-radius: 99px; }
.photo .none { color: #8fa1ab; font-size: .8rem; display: flex; align-items: center; justify-content: center; height: 100%; text-align: center; padding: 8px; }
.photo .meta { padding: 9px 11px; font-size: .86rem; } .photo .meta b { display: block; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 3.4rem; font-weight: 700; letter-spacing: 6px; text-align: center; padding: 18px 0 6px; color: var(--accent-2); }
.label { border: 1.5px dashed #9aa7b1; border-radius: 8px; padding: 12px 16px; width: 260px; text-align: center; background: #fff; }
.label b { font-size: 1.5rem; display: block; }

.login { max-width: 380px; margin: 9vh auto; padding: 0 16px; } .login .card { padding: 24px; } .login img { height: 44px; display: block; margin: 0 auto 16px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } nav.side { position: static; height: auto; } nav.side .items { display: flex; flex-wrap: wrap; gap: 2px; } nav.side h4 { display: none; }
  main { padding: 16px 14px 50px; } .g2, .g3, .g4 { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; }
  .card.tight { overflow-x: auto; }
}
@media print { nav.side, .actions, .flash, form { display: none !important; } .shell { display: block; } body { background: #fff; } .label { break-inside: avoid; } }
.roles th { white-space: normal; font-size: .64rem; padding: 8px 4px; min-width: 52px; letter-spacing: .2px; text-align: center; } .roles th:first-child { text-align: left; padding-left: 12px; }
.roles td { padding: 8px 4px; } .roles td:first-child { padding-left: 12px; }
.g5 { grid-template-columns: repeat(5, 1fr); } a.stat { color: var(--ink); display: block; } a.stat[href]:hover { border-color: var(--accent); text-decoration: none; } a.stat[href] b { color: var(--accent); }
@media (max-width: 860px) { .g5 { grid-template-columns: 1fr 1fr; } }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; } fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 6px 14px 14px; margin: 14px 0 0; } legend { font-weight: 600; padding: 0 6px; font-size: .95rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 14px; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; } .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.qr svg { width: 210px; height: 210px; display: block; margin: 0 auto; }
pre.msg { white-space: pre-wrap; background: #f6f8fa; border: 1px solid var(--line); border-radius: 7px; padding: 10px; font-size: .84rem; margin: 6px 0; }
.id { white-space: nowrap; }
.find { position: relative; margin: 0 4px 6px; } .find input { width: 100%; padding: 7px 10px; border-radius: 7px; border: 1px solid #2c4a58; background: #0b1a22; color: #fff; font: inherit; font-size: .86rem; }
.find input::placeholder { color: #7d97a3; } #found { position: absolute; left: 0; top: 100%; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 40; padding: 4px 0; margin-top: 4px; }
#found a { display: block; padding: 8px 12px; color: var(--ink); font-size: .9rem; } #found a:hover { background: var(--bg); text-decoration: none; } #found a.go { border-top: 1px solid var(--line); color: var(--accent); }
/* 0.4.0: people list, person page, passwords shown once */
main.wide { max-width: none; }
table.list td, table.list th { white-space: nowrap; padding: 8px 12px; vertical-align: middle; }
table.list tbody tr { cursor: pointer; } table.list tr.off td { color: var(--muted); } table.list tr.hl td { background: #fff8e1; }
.fitrow { flex-wrap: nowrap; align-items: center; } .cols h3 { margin-top: 4px; }
details.card > summary { cursor: pointer; } details.card[open] > summary { margin-bottom: 8px; }
.secret { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff8e1; border: 1px solid #e6c766; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.secret > div { flex: 1; min-width: 220px; }
.secret code { font: 700 1.5rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; background: #fff; border: 1px solid #e6c766; border-radius: 7px; padding: 6px 14px; user-select: all; }
/* 0.4.1: diagnostic photos on the phone page */
.diags { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.diag { display: grid; grid-template-columns: 150px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.diag img { width: 150px; border-radius: 6px; display: block; }
