* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #222; }
.topbar { background: #2c3e50; color: #fff; padding: 12px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.topbar h1 { font-size: 18px; margin: 0; }
.topbar nav a { color: #cfd8e3; text-decoration: none; margin-right: 14px; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.active { color: #fff; border-bottom: 2px solid #4aa3ff; padding-bottom: 2px; }
main { max-width: 1100px; margin: 20px auto; padding: 0 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.stat-card.warn .stat-num { color: #d9534f; }
.stat-num { font-size: 26px; font-weight: 700; }
.stat-label { color: #777; font-size: 13px; margin-top: 4px; }

.table-wrap { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto; }
.table-wrap h2 { font-size: 16px; margin: 0 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eee; white-space: nowrap; }
th { color: #555; font-weight: 600; background: #fafafa; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: #999; padding: 24px; }
.row-low td { background: #fff4f4; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.tag-ok { background: #e6f7ee; color: #1a7f4b; }
.tag-warn { background: #fdecea; color: #c0392b; }
.tag-in { background: #e6f0ff; color: #1a5fb4; }
.tag-out { background: #fff1e0; color: #b36b00; }

.form-card { background: #fff; border-radius: 8px; padding: 20px; max-width: 480px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.form-card label { display: block; margin-bottom: 12px; font-size: 14px; color: #444; }
.form-card input, .form-card select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #ccd; border-radius: 6px; font-size: 14px; }
button { background: #2c7be5; color: #fff; border: 0; padding: 9px 20px; border-radius: 6px; font-size: 14px; cursor: pointer; }
button:hover { background: #1a63c8; }
.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.msg-error { background: #fdecea; color: #c0392b; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; background: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.filter-bar label { font-size: 13px; color: #555; }
.filter-bar input, .filter-bar select { display: block; margin-top: 4px; padding: 6px 8px; border: 1px solid #ccd; border-radius: 6px; }