:root {
  color-scheme: light;
  --ink: #152941;
  --muted: #53677e;
  --line: #dbe4ee;
  --surface: #fff;
  --bg: #f3f6fb;
  --blue: #205fcd;
  --side: #14263e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #79a9fb; outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.85rem; line-height: 1.24; }
h2 { font-size: 1.12rem; }
p, .muted { color: var(--muted); }
.break { overflow-wrap: anywhere; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { background: var(--side); padding: 24px 16px; color: #e7eef7; }
.brand { display: flex; gap: 12px; align-items: center; color: white; font-size: 1.15rem; font-weight: 750; padding: 0 8px; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--blue); color: #fff; font: 700 .91rem/1 ui-monospace, monospace; flex: none; }
.sidebar nav { display: grid; gap: 6px; margin-top: 38px; }
.sidebar nav a { padding: 11px 13px; color: #d7e3f0; font-size: .94rem; border-radius: 8px; white-space: nowrap; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: #244771; color: #fff; text-decoration: none; }
.topbar { min-height: 62px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 10px 32px; gap: 12px; color: var(--muted); font-size: .9rem; }
.account, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.account strong { color: var(--ink); overflow-wrap: anywhere; }
.link { padding: 0; border: 0; background: none; color: var(--blue); }
.content { max-width: 1520px; margin-inline: auto; padding: 30px 32px 50px; }
.page-heading, .panel-head, .pagination { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.page-heading { margin-bottom: 22px; }
.page-heading p { margin-top: 7px; }
.page-heading .actions { flex-shrink: 0; }
.page-heading h1 { overflow-wrap: anywhere; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; min-height: 40px; background: white; border: 1px solid #c6d4e3; color: var(--ink); font-size: .9rem; font-weight: 600; border-radius: 8px; white-space: nowrap; }
.button:hover { background: #eff5ff; text-decoration: none; }
.button.primary { background: var(--blue); color: white; border-color: var(--blue); }
.button.primary:hover { background: #174fae; }
.button.small { min-height: 34px; padding: 5px 11px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 12px #19315708; }
.stat { padding: 16px 19px; color: var(--muted); }
.stat:hover { text-decoration: none; }
a.stat:hover { border-color: #83aaf0; }
.stat strong { display: block; color: var(--ink); font-size: 1.85rem; line-height: 1.25; margin-top: 6px; font-variant-numeric: tabular-nums; }
.panel { padding: 20px; margin-bottom: 18px; }
.panel h2 + p, .panel h2 + .table-scroll { margin-top: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin: 16px 0; }
.grow { flex: 1 1 245px; min-width: 0; }
input:not([type=checkbox]), select, textarea { max-width: 100%; min-height: 40px; border: 1px solid #c6d4e3; border-radius: 8px; padding: 8px 10px; background: #fff; font-size: .93rem; }
input[type=checkbox] { accent-color: var(--blue); width: 16px; height: 16px; vertical-align: middle; }
.date-filter { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .875rem; }
.table-scroll { overflow-x: auto; margin-top: 8px; }
table { width: 100%; text-align: left; border-collapse: collapse; font-size: .9rem; }
.inventory-table { min-width: 700px; }
th, td { padding: 12px 11px; vertical-align: top; overflow-wrap: anywhere; }
th { background: #f1f5fa; color: #465e79; font-weight: 650; }
td { border-bottom: 1px solid #e8edf3; }
td.serial { max-width: 260px; }
tbody tr:hover { background: #f9fbff; }
.serial { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 650; }
.sub { display: block; font-size: .84rem; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; white-space: nowrap; padding: 2px 9px; border-radius: 20px; font-size: .83rem; font-weight: 600; }
.badge.in { background: #e3f6ec; color: #116344; }
.badge.out { background: #edf1f6; color: #465b74; }
.empty { padding: 32px 12px; text-align: center; color: var(--muted); }
.pagination { margin-top: 14px; font-size: .88rem; color: var(--muted); }
.back { display: inline-block; margin-bottom: 12px; font-size: .9rem; }
.stack { display: grid; gap: 14px; margin-top: 16px; }
.field { display: grid; gap: 5px; }
.field label { font-size: .91rem; font-weight: 650; }
.field small { color: var(--muted); font-size: .85rem; }
.form-panel { max-width: 780px; }
textarea { resize: vertical; width: 100%; }
.notice { padding: 10px 13px; margin: 0 0 12px; border-radius: 8px; background: #e8f1ff; color: #204f89; overflow-wrap: anywhere; }
.notice.success { background: #e2f5e9; color: #116344; }
.notice.error, .errorlist { background: #fde9e8; color: #9a2722; }
.errorlist { margin: 0; padding: 8px 12px 8px 28px; border-radius: 8px; }
.error-text { color: #9a2722; }
.definition { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.definition dt, .event-title span { color: var(--muted); font-size: .88rem; }
.definition dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.event { padding: 12px 0; border-bottom: 1px solid var(--line); }
.event-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.event p { margin-top: 5px; overflow-wrap: anywhere; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login-panel { width: min(100%, 420px); padding: 30px; }
.login-panel h1 { margin: 15px 0 7px; }
.confirm { border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 850px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding: 14px 16px 8px; }
  .sidebar nav { display: flex; flex-wrap: wrap; margin-top: 8px; gap: 2px; }
  .sidebar nav a { padding: 6px 9px; }
  .topbar, .content { padding-inline: 16px; }
  .page-heading { align-items: start; flex-direction: column; }
}
@media (max-width: 420px) {
  .stats { gap: 6px; }
  .stat { padding: 10px 8px; font-size: .88rem; }
  .panel { padding: 12px; }
  .stat strong { font-size: 1.45rem; }
}

@media (max-width: 640px) {
  .imports-head { align-items: start; flex-direction: column; }
}

.desk-bar {
  display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center;
  gap: 10px; margin-bottom: 18px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #eef4fe; color: #27466b; font-size: .9rem;
}
