:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: #172033;
  background: #f3f5f9;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 360px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
.hidden { display: none !important; }
.muted { color: #68758a; }
.error { min-height: 20px; color: #c73545; margin: 8px 0; }
.warning { color: #a44b12; }
.notice { min-height: 20px; color: #177453; margin: 8px 0; }
.card { background: #fff; border: 1px solid #e2e7ef; border-radius: 14px; box-shadow: 0 10px 30px rgba(27, 39, 66, .05); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); padding: 36px; }
.login-card h1 { font-size: 25px; margin: 12px 0 6px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; color: white; background: #6956e8; font-size: 25px; font-weight: 700; }
label { display: grid; gap: 7px; margin-top: 18px; font-weight: 600; }
input, select { width: 100%; border: 1px solid #ccd4e1; border-radius: 8px; background: #fff; color: #172033; padding: 10px 12px; outline: none; }
input:focus, select:focus { border-color: #6956e8; box-shadow: 0 0 0 3px rgba(105, 86, 232, .12); }
button { border: 0; border-radius: 8px; padding: 9px 14px; font-weight: 600; white-space: nowrap; }
.primary { color: #fff; background: #6956e8; }
.primary:hover { background: #5845d2; }
.secondary { color: #34415a; background: #edf0f5; }
.secondary:hover { background: #e1e6ee; }
.danger { color: #fff; background: #c83b4b; }
.wide { width: 100%; margin-top: 10px; padding: 11px; }
.dashboard { max-width: 1680px; margin: auto; padding: 26px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.topbar h1 { margin: 0 0 6px; font-size: 25px; }
.topbar p { margin: 0; }
.account-bar { display: flex; align-items: center; gap: 14px; }
.workspace { padding: 20px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-group { display: flex; gap: 10px; flex: 1; justify-content: flex-end; }
.search-group input { max-width: 250px; }
.search-group select { max-width: 130px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1250px; }
th { text-align: left; padding: 13px 12px; color: #68758a; background: #f7f8fb; font-size: 12px; font-weight: 600; }
td { padding: 14px 12px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
td strong, td small { display: block; }
td small { color: #748096; margin-top: 5px; line-height: 1.45; }
.account-name { font-size: 15px; }
.device-code { max-width: 170px; overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: #177453; background: #e8f7f0; }
.badge.off { color: #697489; background: #edf0f4; }
.badge.bad { color: #b83243; background: #fcedef; }
.badge.warn { color: #a45a15; background: #fff3e4; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 240px; }
.row-actions button { padding: 6px 9px; color: #42506a; background: #f0f2f6; font-size: 12px; }
.row-actions button.danger-text { color: #b83243; }
.actions-column { min-width: 260px; }
.empty { text-align: center; padding: 50px; color: #748096; }
dialog { width: min(460px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 70px rgba(20, 29, 49, .25); }
dialog::backdrop { background: rgba(20, 28, 44, .45); }
.dialog-form { padding: 26px; }
.dialog-form h2 { margin: 0 0 8px; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.password-result { display: block; padding: 16px; margin-top: 18px; border-radius: 8px; background: #f1f3f8; color: #242f48; overflow-wrap: anywhere; user-select: all; font-size: 16px; }
.audit-dialog { width: min(720px, calc(100% - 30px)); }
.audit-list { max-height: 55vh; overflow-y: auto; margin-top: 16px; }
.audit-item { padding: 13px 0; border-bottom: 1px solid #e8ecf2; }
.audit-item header { display: flex; justify-content: space-between; gap: 16px; font-weight: 600; }
.audit-item p { margin: 6px 0 0; color: #68758a; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .dashboard { padding: 14px; }
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 20px; }
  .account-bar { flex-direction: column; align-items: flex-end; }
  .search-group { order: 3; width: 100%; justify-content: stretch; flex-wrap: wrap; }
  .search-group input { max-width: none; flex: 1; min-width: 180px; }
  .workspace { padding: 12px; }
  .login-card { padding: 26px; }
}
