:root {
  --bg: #f4f4f4;
  --card: #ffffff;
  --field: #ececec;
  --field-2: #f2f2f2;
  --line: #e6e6e6;
  --text: #1b1b1b;
  --muted: #646a70;
  /* Iron Mountain blues (from the logo): navy, slate, blue, cyan */
  --navy: #02365d;
  --primary: #1b5e8f;
  --primary-dark: #0f4470;
  --primary-soft: #dcebf6;
  --primary-disabled: #9fbfd8;
  --im-slate: #42769f;
  --im-blue: #3d98d2;
  --im-cyan: #2ebaea;
  --blue: #3456d6;
  --blue-soft: #e1e7fa;
  --green: #3f8f4a;
  --green-soft: #e1f0e2;
  --red: #c0392b;
  --amber: #a76a00;
  --amber-soft: #fbefd6;
  --radius: 14px;
  --nav-h: 84px;
  --net-h: 34px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px calc(var(--nav-h) + var(--net-h) + 40px); }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }
h1 { font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 0 0 4px; }
h3 { font-size: 17px; margin: 0 0 12px; }
p { margin: 0; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card, .card + .section, .section + .card { margin-top: 16px; }
.section { margin-top: 26px; }
.flat { background: #f7f7f7; }

/* forms */
label.f { display: block; font-weight: 600; margin-bottom: 14px; }
label.f > span.req { color: var(--red); margin-left: 6px; }
label.f .help { display: block; font-weight: 400; color: var(--muted); font-size: 14px; margin-top: 6px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 8px; font: inherit; color: var(--text);
  background: var(--field); border: 1px solid transparent; border-radius: 10px; padding: 12px 14px; outline: none;
}
.card input, .card select, .card textarea { background: var(--field-2); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #fff; }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
input[readonly] { color: var(--text); }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; margin-right: 20px; }
.check input { width: 20px; height: 20px; margin: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-weight: 600;
  border: 0; border-radius: 10px; padding: 12px 18px; cursor: pointer; background: var(--field); color: var(--text); text-decoration: none;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:not(:disabled):hover { background: var(--primary-dark); }
.btn:focus-visible, .icon-btn:focus-visible, .nav a:focus-visible, .tabs button:focus-visible, .chip:focus-visible { outline: 3px solid var(--im-cyan); outline-offset: 2px; }
.btn.primary:disabled { background: var(--primary-disabled); }
.btn:disabled { opacity: .7; cursor: default; }
.btn.block { width: 100%; }
.btn.danger { background: #fbe4e1; color: var(--red); }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* badges */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 14px; background: var(--field); color: #444; white-space: nowrap; font-weight: 500; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--field); padding: 2px 6px; border-radius: 6px; font-size: 14px; }

/* section heading with icon */
.sec-head { display: flex; gap: 14px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.sec-head svg { width: 26px; height: 26px; color: var(--primary); flex: none; margin-top: 2px; }
.sec-head p { color: var(--muted); margin-top: 4px; }

/* tabs */
.tabs { display: flex; gap: 4px; background: var(--field); border-radius: 14px; padding: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 26px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: transparent; font: inherit; font-weight: 500; color: #555; padding: 10px 16px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* lists & tables */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; }
.list .item.click { cursor: pointer; }
.list .item.click:hover { background: #fafafa; }
.grow { flex: 1; min-width: 0; }
.title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 15px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: #555; font-size: 15px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
th .sort { opacity: .5; font-size: 12px; margin-left: 4px; }
td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafafa; }
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.stat .label { color: var(--muted); }
.stat .value { font-size: 34px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -0.02em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stats .card + .card { margin-top: 0; }
.bar { height: 10px; background: var(--field); border-radius: 999px; overflow: hidden; margin: 10px 0 20px; }
.bar > div { height: 100%; background: var(--primary); border-radius: 999px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'l v' 'b b'; gap: 4px 10px; align-items: center; margin: 10px 0; font-size: 15px; }
.hbar > span { grid-area: l; } .hbar > b { grid-area: v; }
.hbar .bar { grid-area: b; margin: 0; height: 8px; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: #999; }
.empty .t { color: var(--text); font-weight: 600; font-size: 18px; margin: 10px 0 4px; }
.info-box { background: #ebebeb; border-radius: var(--radius); padding: 18px 20px; color: var(--muted); }
.info-box b { color: var(--text); }

/* tag flow */
.stepper { display: flex; align-items: center; gap: 10px; }
.steps { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; color: #888; }
.step { padding: 6px 14px; border-radius: 999px; background: var(--field); color: #666; font-weight: 500; }
.step.done { background: var(--green-soft); color: var(--green); }
.step.cur { background: var(--blue-soft); color: var(--blue); }
.entity-pick { display: grid; gap: 12px; }
.pick { text-align: left; display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; font: inherit; cursor: pointer; }
.pick.on { border-color: var(--primary); background: #f1f7fc; }
.pick svg { width: 24px; height: 24px; color: var(--primary); }
.locked .ent { color: var(--primary); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.locked .ent svg { width: 20px; height: 20px; }
.locked .room { font-size: 26px; font-weight: 700; margin: 8px 0; }
.tag-head { display: flex; gap: 16px; margin-bottom: 20px; }
.tag-head .ico { width: 52px; height: 52px; border-radius: 12px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; flex: none; color: var(--primary); }
.tag-head .ico svg { width: 26px; height: 26px; }
.tag-head h2 { font-size: 24px; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 280px; overflow-y: auto; }
.combo-list button { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.combo-list button:first-child { border-top: 0; }
.combo-list button small { display: block; color: var(--muted); }
.combo-list button:hover { background: #f5f5f5; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #ddd; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.photo-empty { background: var(--field-2); border-radius: 12px; padding: 30px; text-align: center; color: var(--muted); margin-top: 12px; }
.photo-empty svg { width: 36px; height: 36px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

/* account */
.avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 34px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.center { text-align: center; }
.kv { display: flex; gap: 16px; align-items: center; }
.kv svg { width: 22px; height: 22px; color: #555; flex: none; }
.kv .k { color: var(--muted); font-size: 15px; }

/* header with the Iron Mountain logo, and navigation */
.topbar { position: sticky; top: 0; z-index: 25; background: #fff; border-bottom: 1px solid var(--line); }
.topbar::after { content: ''; display: block; height: 3px; background: linear-gradient(90deg, var(--navy), var(--im-blue) 55%, var(--im-cyan)); }
.topbar-in { max-width: 1440px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); flex: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand .app-name { font-weight: 600; font-size: 15px; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; }
.brand .plain-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; }
.brand .plain-mark svg { width: 20px; height: 20px; }
.brand .plain-name { font-weight: 700; font-size: 18px; }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.top-user .av { text-decoration: none; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
/* phones and tablets: floating bottom bar */
.nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--net-h) + 8px + env(safe-area-inset-bottom)); max-width: 736px; margin: 0 auto;
  background: #fff; border-radius: 40px; box-shadow: 0 6px 30px rgba(2,54,93,.16); display: flex; overflow-x: auto; scrollbar-width: none;
  padding: 6px; gap: 2px; z-index: 20;
}
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: 1 0 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 30px; color: #555; text-decoration: none; font-size: 13px; font-weight: 500; position: relative; white-space: nowrap; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { background: var(--primary-soft); color: var(--primary); }
.nav .dot { position: absolute; top: 4px; right: 16px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
/* desktops: navigation sits in the header, like tabs */
@media (min-width: 1000px) {
  :root { --nav-h: 0px; }
  .nav { position: static; box-shadow: none; border-radius: 12px; padding: 0; background: transparent; max-width: none; margin: 0; flex: 1; justify-content: center; overflow: visible; }
  .nav a { flex: none; flex-direction: row; gap: 7px; padding: 8px 12px; border-radius: 10px; font-size: 15px; }
  .nav a svg { width: 17px; height: 17px; }
  .nav a:not(.on):hover { background: #f1f4f7; color: var(--text); }
  .nav .dot { position: static; margin-left: 2px; }
  .top-user { margin-left: 0; flex: none; }
}
@media (min-width: 1000px) and (max-width: 1480px) { .top-user .nm { display: none; } }
@media (min-width: 1000px) and (max-width: 1380px) { .brand .app-name { display: none; } .nav a { padding: 8px 9px; gap: 6px; } .topbar-in { gap: 12px; } }
@media (min-width: 1000px) and (max-width: 1180px) { .nav a svg { display: none; } }
@media (max-width: 560px) { .brand img { height: 28px; } .brand .app-name { font-size: 14px; } .top-user .nm { display: none; } }

/* online / offline status strip */
.netbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; height: calc(var(--net-h) + env(safe-area-inset-bottom)); padding: 0 16px env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13.5px; font-weight: 500; background: #eef6ee; color: #245c2c; border-top: 1px solid #cfe5d2; }
.netbar .led { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px rgba(63,143,74,.18); }
.netbar.off { background: #fff4e0; color: #6b4700; border-top-color: #f1d9a8; }
.netbar.off .led { background: var(--amber); box-shadow: 0 0 0 3px rgba(167,106,0,.18); }
.netbar.sync .led { background: var(--im-blue); animation: pulse 1s infinite alternate; }
.netbar a { color: inherit; font-weight: 700; }
.netbar .sep { opacity: .5; }
@keyframes pulse { to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .netbar.sync .led { animation: none; } }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 20px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.modal-head h2 { margin: 0; }
#reader { width: 100%; border-radius: 12px; overflow: hidden; background: #000; min-height: 240px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--net-h) + 28px); transform: translateX(-50%) translateY(20px); background: #222; color: #fff; padding: 12px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); font-weight: 500; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--red); }
.err-text { color: var(--red); font-size: 15px; margin-top: 8px; }
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 15px; }
.detail-grid .k { color: var(--muted); }
.login-wrap { min-height: calc(100vh - 140px); display: grid; grid-template-columns: 1fr; gap: 0; max-width: 980px; margin: 4vh auto 0; background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 10px 40px rgba(2,54,93,.08); }
@media (min-width: 860px) { .login-wrap { grid-template-columns: 1.05fr 1fr; min-height: 560px; } }
.login-hero { background: linear-gradient(135deg, #02365d, #2a7fb5 60%, #6ccef5); background-size: cover; background-position: center; color: #fff; padding: 28px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 180px; }
.login-hero.img { background-image: linear-gradient(180deg, rgba(2,54,93,0) 45%, rgba(2,54,93,.55)), url('/brand/login-hero.jpg'); }
.login-hero h2 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.01em; }
.login-hero p { opacity: .9; }
.login { padding: 34px 30px 30px; display: flex; flex-direction: column; justify-content: center; }
.login .logo-img { height: 44px; width: auto; align-self: flex-start; margin-bottom: 26px; }
.login h1 { font-size: 28px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-wrap button { position: absolute; right: 6px; bottom: 6px; width: 40px; height: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }
.pw-wrap button svg { width: 20px; height: 20px; }
.temp-pw { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 24px; font-weight: 700; letter-spacing: .04em; background: var(--primary-soft); color: var(--navy); padding: 14px 16px; border-radius: 12px; text-align: center; margin: 12px 0; user-select: all; }

/* ===================== v2 modules ===================== */
:root { --orange: #b4561f; --orange-soft: #fbe6d8; --red-soft: #fbe4e1; --pending: #c9cfd2; --purple: #6b4aa3; --purple-soft: #ece5f7;
  --r-found: #3f8f4a; --r-damaged: #7a52b3; --r-misplaced: #b8801a; --r-missing: #c0392b; }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid2 > * { min-width: 0; }
.grid2 .card + .card { margin-top: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-card.scroll-x table { min-width: 640px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.dot-i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.t-found { background: var(--r-found); } .t-misplaced { background: var(--r-misplaced); } .t-damaged { background: var(--r-damaged); } .t-missing { background: var(--r-missing); } .t-pending { background: var(--pending); } .t-unlisted { background: var(--blue); }
.segbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--field); margin: 12px 0; }
.segbar > div { height: 100%; }
.segbar > div + div { box-shadow: -2px 0 0 #fff; }
.big-pct { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.field-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field-row > label.f { flex: 1 1 160px; margin-bottom: 0; min-width: 0; }
.field-row > .btn { flex: none; }
.inline-input { display: flex; gap: 8px; }
.inline-input input { margin: 0; flex: 1; min-width: 0; }
.result-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0 6px; }
@media (min-width: 560px) { .result-btns { grid-template-columns: repeat(4, 1fr); } }
.rbtn { border: 2px solid transparent; border-radius: 12px; padding: 14px 10px; font: inherit; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rbtn svg { width: 24px; height: 24px; }
.rbtn.found { background: var(--green-soft); color: var(--green); } .rbtn.misplaced { background: var(--amber-soft); color: var(--amber); }
.rbtn.damaged { background: var(--purple-soft); color: var(--purple); } .rbtn.missing { background: var(--red-soft); color: var(--red); }
.rbtn.sel { border-color: currentColor; }
.rbtn:disabled { opacity: .5; cursor: default; }
.notice { border-radius: 12px; padding: 12px 14px; background: var(--amber-soft); color: #6b4700; font-size: 15px; }
.notice.info { background: var(--blue-soft); color: #23398f; }
.notice.ok { background: var(--green-soft); color: #245c2c; }
.room-card { border: 1px dashed var(--primary); border-radius: 12px; padding: 12px 14px; background: #f3f8fa; margin: 4px 0 14px; }
.room-card .t { font-weight: 700; }
.mini-btn { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; color: var(--text); white-space: nowrap; }
.mini-btn.found { color: var(--green); border-color: #bfdcc2; }
.list .item .acts { display: flex; gap: 6px; flex: none; }
.crumbs { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.barcode-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: inline-block; max-width: 100%; overflow-x: auto; }
.barcode-box svg { display: block; max-width: 100%; height: auto; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.room-label { border: 1px solid #ccc; border-radius: 8px; padding: 10px; text-align: center; background: #fff; color: #000; break-inside: avoid; }
.room-label .ln { font-weight: 700; font-size: 14px; }
.room-label .ls { font-size: 11px; color: #444; margin-bottom: 6px; }
.room-label svg { max-width: 100%; height: auto; }
.loc-head { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 18px 6px; background: #fafafa; border-top: 1px solid var(--line); }
.list .loc-head:first-child { border-top: 0; }
.steps-mini { display: flex; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.steps-mini b { color: var(--primary); }
.map-table td, .map-table th { padding: 8px 10px; font-size: 14px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* customizable dashboard */
.dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; grid-auto-flow: row dense; }
.w { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; position: relative; display: flex; flex-direction: column; }
.w.s { grid-column: span 1; } .w.m { grid-column: span 2; } .w.l { grid-column: span 4; }
@media (max-width: 900px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } .w.l, .w.m { grid-column: span 2; } }
.w .wt { color: var(--muted); font-size: 15px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.w .wv { font-size: clamp(22px, 2.6vw, 32px); white-space: nowrap; font-weight: 700; margin: 6px 0 2px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.w .ws { color: var(--muted); font-size: 14px; }
.w h3 { margin-bottom: 10px; font-size: 16px; }
.w .more { margin-top: auto; padding-top: 10px; font-size: 14px; }
.dash.editing .w { border: 2px dashed var(--primary-disabled); cursor: grab; }
.dash.editing .w.drag-over { border-color: var(--primary); background: #f3f8fa; }
.wtools { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.wtools button { font: inherit; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 8px; cursor: pointer; color: var(--text); min-width: 30px; }
.wtools button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.wtools .sep { flex: 1; }
.edit-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; background: var(--primary); color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.edit-bar .btn { padding: 8px 12px; }
.edit-bar .grow { font-weight: 600; }
.hidden-tray { margin-bottom: 14px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: #b9c3c7; stroke-width: 1; }
.chart .grid { stroke: #eceff0; stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.line { height: 3px; background: var(--text); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi-grid .card { padding: 16px; } .kpi-grid .card + .card { margin-top: 0; }
.kpi-grid .value { font-size: 26px; }
.kpi-grid .value.txt { font-size: 18px; line-height: 1.25; margin-top: 8px; }
.neg { color: var(--red); } .pos { color: var(--green); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.filters label.f { margin: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.staff-grid td { padding: 6px 8px; } .staff-grid input { margin: 0; padding: 8px 10px; }

@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .labels { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .room-label { border: 1px solid #999; }
  .no-print { display: none !important; }
}

/* ===================== v4 ===================== */
.today-box { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.today-box > div { padding: 12px 16px; border-left: 1px solid var(--line); min-width: 0; }
.today-box > div:first-child { border-left: 0; background: linear-gradient(135deg, var(--navy), var(--primary)); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.today-box .k { font-size: 13px; color: var(--muted); white-space: nowrap; }
.today-box > div:first-child .k { color: rgba(255,255,255,.8); }
.today-box .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.today-box .d { font-weight: 700; font-size: 16px; white-space: nowrap; }
.today-box .v.wait { color: var(--amber); }
@media (max-width: 560px) { .today-box { grid-template-columns: repeat(3, minmax(0, 1fr)); } .today-box > div:first-child { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; padding: 8px 14px; } .today-box > div:nth-child(2) { border-left: 0; } .today-box .v { font-size: 22px; } }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } }
@media (min-width: 761px) and (max-width: 980px) { .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.barcode-row { display: flex; gap: 10px; align-items: flex-start; }
.barcode-row label.f { flex: 1; min-width: 0; }
.barcode-row .btn { margin-top: 31px; flex: none; }
.field-err { display: block; color: var(--red); font-size: 14px; font-weight: 500; margin-top: 6px; }
input.invalid { border-color: var(--red) !important; background: #fff6f5 !important; }
.rules-hint { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-weight: 400; }
.rules-hint .code { font-size: 13px; }
.room-saved { background: #f1f7fc; border-radius: 10px; padding: 10px 12px; font-weight: 400; margin-top: 8px; font-size: 15px; white-space: pre-wrap; }
.new-room { display: inline-block; font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px; }
.seg { display: inline-flex; background: var(--field); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 8px; cursor: pointer; color: #555; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.team-table { width: 100%; font-size: 14px; }
.team-table th, .team-table td { padding: 8px 8px; border: 0; border-top: 1px solid var(--line); cursor: default; white-space: nowrap; }
.team-table thead th { border-top: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.team-table td.num, .team-table th.num { text-align: right; }
.team-table tr.me td { background: #f1f7fc; }
.team-table td .bar { margin: 4px 0 0; height: 5px; min-width: 60px; }
.team-table .zero { color: #b3b8bd; }
.team-wrap { overflow-x: auto; margin: 0 -6px; }
.dash-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -8px 0 16px; }
.dash-filter select { width: auto; min-width: 220px; margin: 0; padding: 9px 40px 9px 12px; background-color: #fff; border: 1px solid var(--line); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumbs .ph { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: #ddd; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .ph button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.thumbs .ph.new::after { content: 'new'; position: absolute; left: 4px; bottom: 4px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(27,94,143,.85); border-radius: 6px; padding: 1px 5px; }
.add-photo { width: 76px; height: 76px; border-radius: 10px; border: 2px dashed var(--primary-disabled); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; background: #fff; }
.add-photo svg { width: 22px; height: 22px; }
.add-photo input { display: none; }
.au-details { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 14px; background: #fbfcfd; }
.au-details > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.au-details > summary::-webkit-details-marker { display: none; }
.au-details[open] > summary { margin-bottom: 12px; }
.was { display: block; font-weight: 400; font-size: 13px; color: var(--amber); margin-top: 4px; }
.req-note { font-size: 13px; font-weight: 600; color: var(--primary); }
.fields-editor .fe-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) auto auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.fields-editor .fe-row:first-child { border-top: 0; }
.fields-editor .fe-row input, .fields-editor .fe-row select { margin: 0; }
.fields-editor .fe-opts { grid-column: 1 / -1; }
.fields-editor .fe-opts textarea { margin: 0; min-height: 60px; }
.fields-editor .check { margin: 0; font-size: 14px; white-space: nowrap; }
@media (max-width: 560px) { .fields-editor .fe-row { grid-template-columns: 1fr 1fr; } }
.settings-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kv-list { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 15px; }
.kv-list .k { color: var(--muted); }
@media (max-width: 560px) { .kv-list { grid-template-columns: 1fr; gap: 2px; } .kv-list .k { margin-top: 8px; } }
.lock-badge { background: var(--red-soft); color: var(--red); }
@media (max-width: 560px) { .hide-xs { display: none; } }
@media (max-width: 560px) {
  #tag-form .barcode-row { flex-direction: column; align-items: stretch; gap: 0; }
  #tag-form .barcode-row .btn { margin: 0 0 16px; }
  .rules-hint .code { white-space: normal; }
}
