:root {
  --bg: #f4f5f9; --panel: #fff; --ink: #1d2433; --muted: #6b7385; --line: #e3e6ee;
  --brand: #243b6b; --accent: #f2c14e; --ok: #1f8a4c; --warn: #b7791f; --bad: #c0392b;
  --radius: 10px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 7px; padding: 6px 12px; }
button:hover { border-color: #b9c0d2; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: #1b2e55; }
button.ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
button.small { padding: 4px 9px; font-size: 13px; }
button.danger { color: var(--bad); }
button.wide { width: 100%; padding: 9px; margin-top: 6px; }
input, select { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 2px solid rgba(36,59,107,.25); border-color: var(--brand); }
.muted { color: var(--muted); }
.error { color: var(--bad); margin-top: 8px; }
[hidden] { display: none !important; }

.topbar { display: flex; align-items: center; gap: 22px; height: 54px; padding: 0 22px; background: var(--brand); color: #fff; }
.logo { font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.logo .mark { color: var(--accent); margin-right: 7px; }
.topbar nav { display: flex; gap: 4px; }
.tab { background: transparent; border: none; color: rgba(255,255,255,.75); padding: 8px 14px; border-radius: 7px; }
.tab.active, .tab:hover { color: #fff; background: rgba(255,255,255,.13); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.85); }

.login-wrap { display: grid; place-items: center; min-height: calc(100vh - 54px); padding: 20px; }
.login-card { width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 10px 30px rgba(20,30,60,.08); }
.login-card h1 { margin: 0 0 4px; font-size: 21px; }
label { display: block; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
label > input, label > select, label > .inline { margin-top: 5px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
label.check input { width: auto; margin: 0; }
.inline { display: flex; gap: 6px; }

.layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 54px); }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; }
.side-head { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: 1px; margin: 0 6px 8px; }
#software-list { list-style: none; margin: 0 0 14px; padding: 0; }
#software-list li { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; cursor: pointer; gap: 6px; }
#software-list li:hover { background: #f0f2f7; }
#software-list li.active { background: #e8edf8; color: var(--brand); font-weight: 600; }
#software-list .count { font-size: 12px; color: var(--muted); font-weight: 400; }
#software-list .del { visibility: hidden; border: none; background: none; color: var(--bad); padding: 0 4px; }
#software-list li:hover .del { visibility: visible; }
.software-form { display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; }
.hint { font-size: 12px; color: var(--muted); margin: 10px 6px; line-height: 1.6; }

.content { padding: 18px 22px; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.toolbar h2 { margin: 0; font-size: 18px; white-space: nowrap; }
.toolbar input { max-width: 300px; margin-left: auto; }
.stats { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; min-width: 110px; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfd; position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
td.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }
td.note { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
td.ops { display: flex; gap: 4px; }
td.ops button { padding: 3px 8px; font-size: 12.5px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; }
.badge.ok { background: #e3f4ea; color: var(--ok); }
.badge.warn { background: #fdf1dc; color: var(--warn); }
.badge.bad { background: #fbe4e1; color: var(--bad); }
.badge.off { background: #eceef3; color: var(--muted); }
.empty { padding: 30px; text-align: center; color: var(--muted); }

dialog { border: none; border-radius: 14px; padding: 22px 24px; width: 380px; box-shadow: 0 20px 50px rgba(20,30,60,.25); }
dialog::backdrop { background: rgba(20,30,60,.35); }
dialog h3 { margin: 0 0 4px; }
.quick { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.quick button { padding: 3px 8px; font-size: 12px; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.2); }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { border-right: none; border-bottom: 1px solid var(--line); }
}
