/* QIE RENTAL admin — layout follows global skill admin-ui; skin follows the public site
   ("scoreboard + spec plate": night sidebar, paper page, square corners, brand indigo, bronze labels).
   Hairlines, numbers biggest, colour in the content area only means status or "current".
   No horizontal scroll anywhere. */
@font-face { font-family: "Qie Display"; src: url("/assets/site/fonts/barlow-condensed-black.woff2") format("woff2"); font-weight: 700 900; font-style: normal; font-display: swap; }
:root {
  /* 颜色跟官网内页（public/assets/site/site.css）对齐：夜色侧栏、纸色页面、品牌紫只做填充和当前项、古铜只做标签和顶线。 */
  --bg: #F2F0EC; --card: #FBFAF7; --line: #D9D4CB; --line-soft: #E9E5DD;
  --ink: #111114; --ink-2: #3D3C45; --ink-3: #55545E; --ink-4: #8A8892;
  --accent: #4A37E0; --accent-fill: #5B46EF; --accent-bg: #EBE8FF; --accent-line: #B9ADFF;
  --ok: #166B38; --ok-bg: #E2F3E7; --warn: #8F4705; --warn-bg: #FBEED0; --bad: #B3261E; --bad-bg: #FBEAE8;
  --night: #111114; --night-2: #1C1C22; --night-line: #3C3B44; --night-ink: #F2F2F2; --night-muted: #B5B4BE;
  --gold: #D6B598; --gold-ink: #7D5F43;
  --brand: #1E6FD9; /* little blue penguin; logo only */
  --shadow: none;
  --pop: 0 0 0 1px var(--ink);
  --r: 0px; --r-s: 0px; --side: 232px;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --label: "Qie Display", "Arial Narrow", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --cut: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", sans-serif; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, td.r, .kpi b { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #FBFBFC; border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--ink); font-weight: 650; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.nav-group { font-size: 12px; color: var(--ink-4); padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-s); color: var(--ink-2); font-size: 14px; }
.nav a:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.nav a svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a .cnt { margin-left: auto; font-size: 12px; color: var(--ink-3); background: var(--line-soft); border-radius: 999px; padding: 0 7px; }
.nav a .cnt.hot { background: var(--bad-bg); color: var(--bad); }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.side-foot .who { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar { display: none; }
.main { min-width: 0; padding: 22px 28px 48px; max-width: 1800px; }

/* ---------- page head ---------- */
.crumb { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head h1 { font-size: 24px; line-height: 1.25; margin: 0; font-weight: 650; }
.head .desc { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--line-soft); text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #1E293B; }
.btn.block { width: 100%; height: 42px; font-size: 14px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); height: 36px; padding: 0 11px; width: 100%; min-width: 0; }
textarea { height: auto; padding: 8px 11px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
label.f { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
label.f small { font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.kpi span { font-size: 12px; color: var(--ink-3); }
.kpi b { display: block; font-size: 22px; font-weight: 650; margin: 2px 0; }
.kpi small { font-size: 12px; color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.alert b { color: var(--bad); }

/* ---------- panel + toolbar + table ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.panel + .panel { margin-top: 16px; }
.panel-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-h h2 { font-size: 15px; margin: 0; font-weight: 650; }
.rt-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rt-search { position: relative; width: 300px; max-width: 100%; }
.rt-search input { padding-left: 32px; }
.rt-search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; stroke: var(--ink-4); fill: none; stroke-width: 2; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--line-soft); border-radius: var(--r-s); padding: 3px; gap: 2px; }
.seg a { padding: 4px 10px; border-radius: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.seg a i { font-style: normal; color: var(--ink-4); margin-left: 4px; }
.rt-tools .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
table.rt { width: 100%; border-collapse: collapse; font-size: 13px; }
.rt th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); background: #FAFBFC; padding: 8px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rt td { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; min-width: 0; }
.rt tr:last-child td { border-bottom: 0; }
.rt th.r, .rt td.r { text-align: right; }
.rt tr[data-href] { cursor: pointer; }
.rt tr[data-href]:hover td { background: #F8FAFF; }
.rt td.go { width: 24px; color: var(--ink-4); text-align: right; }
.id1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.id1 .av { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 650; color: #fff; flex: none; }
.id1 .t { min-width: 0; }
.id1 .t b { display: block; font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id1 .t small { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--line-soft); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.blue { background: var(--accent-bg); color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: #D97706; } .dot.bad { background: var(--bad); }
.empty { padding: 40px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }

/* ---------- alerts ---------- */
.note { border-radius: var(--r-s); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; background: var(--accent-bg); color: #1E3A8A; }
.note.bad { background: var(--bad-bg); color: #991B1B; }
.note.ok { background: var(--ok-bg); color: #166534; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px 28px 24px; }
.auth-card .brand { padding: 0 0 18px; }
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card .desc { color: var(--ink-3); font-size: 13px; margin: 0 0 6px; }
.auth-card .btn.block { margin-top: 18px; }
.otp { font-family: var(--mono); font-size: 24px !important; letter-spacing: .45em; text-align: center; height: 52px !important; }
.secret { font-family: var(--mono); font-size: 14px; letter-spacing: .06em; background: var(--line-soft); border-radius: var(--r-s); padding: 10px; text-align: center; overflow-wrap: anywhere; }
#qr { display: grid; place-items: center; padding: 6px 0 12px; }
#qr svg { width: 180px; height: 180px; }
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- confirm dialog ---------- */
.ui-dlg { position: fixed; inset: 0; background: rgba(15,23,42,.35); display: grid; place-items: center; padding: 16px; z-index: 50; }
.ui-dlg > div { background: #fff; border-radius: 14px; box-shadow: var(--pop); padding: 20px; width: 100%; max-width: 380px; }
.ui-dlg p { margin: 0 0 16px; }
.ui-dlg .row { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- responsive (media queries last) ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s ease, visibility .2s; visibility: hidden; }
  body.nav-open .side { transform: none; visibility: visible; box-shadow: var(--pop); }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; background: rgba(246,247,249,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 8px 16px; }
  .topbar .brand { padding: 0; font-size: 14px; min-height: 40px; }
  .topbar .brand img { width: 26px; height: 26px; }
  .topbar button { margin-left: auto; }
  .main { padding: 16px 16px 40px; }
  .head h1 { font-size: 22px; }
  .rt-search { width: 100%; }
  .seg a { padding: 8px 12px; } /* tap targets >= 32px on phones */
  .id1 .t b, .id1 .t small { white-space: normal; overflow-wrap: anywhere; } /* long names wrap, never widen the table */
  .rt td, .rt th { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- detail pages (stage 2) ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.detail > * { min-width: 0; }
.side-col { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; }
.kv > div { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.kv dt { font-size: 12px; color: var(--ink-3); margin: 0 0 2px; }
.kv dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.card-b { padding: 4px 16px 16px; }
.card-b .f:first-child { margin-top: 10px; }
.next { border-color: var(--accent-line); }
.next .panel-h { background: var(--accent-bg); border-radius: var(--r) var(--r) 0 0; }
.next .panel-h h2 { color: #1E3A8A; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row2 label.f { margin-top: 12px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.sum td { padding: 8px 16px; }
.sum tr.total td { font-weight: 650; border-top: 1px solid var(--line); }
.sum tr.due td { color: var(--bad); font-weight: 650; }
.tl { list-style: none; margin: 0; padding: 8px 16px 12px; }
.tl li { position: relative; padding: 6px 0 6px 18px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; left: 3px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.tl li small { color: var(--ink-3); margin-left: 6px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
details.more { border-top: 1px solid var(--line); }
details.more summary { cursor: pointer; padding: 12px 16px; font-size: 13px; color: var(--ink-2); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: " ›"; color: var(--ink-4); }
details.more[open] summary::after { content: " ⌄"; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.form-card { max-width: 760px; }
@media (max-width: 1100px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; order: -1; }
}
@media (max-width: 860px) {
  .row2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 860px) { .kv dd a { display: inline-block; padding: 8px 0; } }
@media (max-width: 860px) { .btn.sm { height: 34px; } }
/* buttons inside narrow table cells wrap their text instead of widening the cell */
.rt td .btn-row .btn { white-space: normal; height: auto; min-height: 34px; padding-top: 4px; padding-bottom: 4px; text-align: center; max-width: 100%; }
.rt td form { min-width: 0; }

/* handover photos (stage 4) */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.shot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px dashed #C9D1DD; border-radius: 10px; background: #FAFBFC; cursor: pointer; overflow: hidden; min-width: 0; }
.shot:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.shot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shot-ph { font-size: 22px; color: var(--ink-4); line-height: 1; }
.shot-l { font-size: 12px; color: var(--ink-3); margin-top: 4px; text-align: center; padding: 0 4px; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot.has .shot-l { position: absolute; bottom: 0; left: 0; right: 0; margin: 0; background: rgba(15,23,42,.6); color: #fff; padding: 2px 4px; }
.shot.has .shot-ph { display: none; }
.cmp { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.cmp-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; }
.cmp-row b { font-size: 13px; padding-top: 4px; }
.cmp figure { margin: 0; min-width: 0; }
.cmp img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.cmp figcaption { font-size: 12px; color: var(--ink-3); }
.cmp-none { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--line-soft); color: var(--ink-4); font-size: 12px; }

/* ---------- skin: same language as the public site (keep last) ---------- */
*, *::before, *::after { border-radius: 0 !important; } /* 全站直角，包括 colfit.js 自己画的按钮和弹层 */
:focus-visible { outline-color: var(--accent-fill); }
.side { background: var(--night); border-right: 0; color: var(--night-muted); }
.side :focus-visible, .topbar :focus-visible { outline-color: var(--gold); }
.brand { font-family: var(--label); font-weight: 900; font-size: 20px; letter-spacing: .04em; line-height: 1.1; }
.side .brand, .topbar .brand { color: var(--night-ink); }
.brand small { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
.side .brand small { color: var(--night-muted); }
.brand small { margin-top: 4px; }
.nav-group { color: var(--gold); letter-spacing: .08em; }
.nav a { color: var(--night-muted); border-left: 3px solid transparent; padding-left: 9px; }
.nav a:hover { background: var(--night-2); color: var(--night-ink); }
.nav a.on { background: var(--night-2); color: var(--night-ink); border-left-color: var(--accent-fill); }
.nav a .cnt { background: var(--night-line); color: var(--night-ink); }
.nav a .cnt.hot { background: var(--gold); color: var(--night); font-weight: 700; }
.side-foot { border-top-color: var(--night-line); color: var(--night-muted); }
.side-foot .btn { background: transparent; border-color: var(--night-line); color: var(--night-ink); }
.side-foot .btn:hover { background: var(--night-2); }
.crumb { color: var(--gold-ink); letter-spacing: .06em; }
.head h1 { font-weight: 800; letter-spacing: -.01em; }
.btn { font-weight: 600; }
.btn:hover { border-color: var(--ink-4); }
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; clip-path: var(--cut); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
input, select, textarea { background-color: #fff; border-color: #B9B4AA; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-fill); }
.kpi { border-top: 2px solid var(--gold); padding-top: 12px; }
.kpi span { color: var(--gold-ink); letter-spacing: .04em; }
.kpi b { font-family: var(--label); font-weight: 900; font-size: 34px; line-height: 1.1; letter-spacing: .01em; }
.panel-h h2 { font-weight: 700; }
.rt th { background: var(--line-soft); color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
.rt tr[data-href]:hover td { background: var(--accent-bg); }
.seg { background: var(--line-soft); }
.seg a.on { background: var(--ink); color: #fff; box-shadow: none; }
.seg a.on i { color: var(--night-muted); }
.pill { font-weight: 600; }
.pill.blue { color: var(--accent); }
.dot.warn { background: var(--warn); }
.note { color: #2A1F8F; border-left: 3px solid var(--accent-fill); }
.note.bad { color: #7A1A14; border-left-color: var(--bad); }
.note.ok { color: #0F4A27; border-left-color: var(--ok); }
.next { border-color: var(--accent-fill); }
.next .panel-h { background: var(--accent-fill); }
.next .panel-h h2 { color: #fff; }
.auth { background: var(--night); }
.auth-card { border: 0; border-top: 3px solid var(--gold); }
.ui-dlg { background: rgba(17,17,20,.6); }
.ui-dlg > div { background: var(--card); }
.shot { background: #fff; border-color: #B9B4AA; }
.cf-btn:hover { border-color: var(--ink-4) !important; color: var(--ink) !important; }
.cf-btn b { color: var(--warn) !important; }
.cf-pop { background: var(--card) !important; border-color: var(--ink) !important; box-shadow: none !important; }
.cf-it:hover { background: var(--accent-bg) !important; }
.cf-it[disabled]:hover { background: none !important; }
.cf-it[aria-pressed="true"] .cf-ck { background: var(--accent-fill) !important; border-color: var(--accent-fill) !important; }
.cf-ft button { color: var(--accent) !important; }
@media (max-width: 860px) {
  .topbar { background: var(--night); border-bottom: 0; backdrop-filter: none; }
  .topbar .btn { background: transparent; border-color: var(--night-line); color: var(--night-ink); }
  body.nav-open .side { box-shadow: 0 0 0 100vmax rgba(17,17,20,.5); }
  /* 手机上格子不再一个字一行：词不拆开，放不下的列交给 colfit.js 收起 */
  .rt td, .rt th, .id1 .t b, .id1 .t small { word-break: keep-all; overflow-wrap: break-word; }
  .kpi b { font-size: 30px; }
}
