* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f5f7fb; color: #172033; }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #cfd8e3; background: #fff; border-radius: 8px; padding: 7px 12px; }
button:hover { background: #f2f6fb; }
button.active { background: #172033; color: #fff; border-color: #172033; }
button.ghost { background: transparent; }
input, textarea { border: 1px solid #cfd8e3; border-radius: 8px; padding: 8px; width: 100%; background: #fff; }
textarea { min-height: 90px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
pre { white-space: pre-wrap; background: #101827; color: #e5e7eb; padding: 12px; border-radius: 8px; overflow: auto; }
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: #fff; border-bottom: 1px solid #e4e9f2; position: sticky; top: 0; z-index: 2; }
.top-status { display: flex; align-items: center; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: #edf2f7; color: #4a5568; font-size: 12px; }
.badge.ok { background: #e6ffed; color: #107c41; }
.badge.bad { background: #ffe8e8; color: #ba1a1a; }
.muted { color: #667085; font-size: 13px; }
.layout { display: grid; grid-template-columns: 330px 1fr; min-height: calc(100vh - 56px); }
.sidebar { border-right: 1px solid #e4e9f2; background: #fff; padding: 12px; overflow: auto; }
.side-head { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.filters { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.device-list { display: flex; flex-direction: column; gap: 8px; }
.device-item { padding: 10px; border: 1px solid #e4e9f2; border-radius: 12px; cursor: pointer; background: #fff; }
.device-item:hover, .device-item.selected { border-color: #172033; }
.device-title { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #b0b8c4; }
.dot.online { background: #12b76a; }
.content { padding: 16px; overflow: auto; }
.card { background: #fff; border: 1px solid #e4e9f2; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.device-summary { display: flex; justify-content: space-between; align-items: center; }
.device-summary h2 { margin: 0 0 4px; }
.actions { display: flex; gap: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-toolbar label { display: flex; align-items: center; gap: 6px; }
.panel-toolbar input { width: 90px; }
.raw-list { display: flex; flex-direction: column; gap: 8px; }
.raw-item { background: #fff; border: 1px solid #e4e9f2; border-radius: 12px; padding: 12px; }
.raw-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.hex { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; word-break: break-all; background: #f8fafc; border-radius: 8px; padding: 8px; }
.send-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.table-wrap table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { border-bottom: 1px solid #edf2f7; padding: 8px; text-align: left; font-size: 13px; vertical-align: top; }
th { background: #f8fafc; }
.login-mask { position: fixed; inset: 0; background: rgba(10,15,25,.45); display: flex; align-items: center; justify-content: center; z-index: 10; }
.login-card { width: 360px; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; }
.error { color: #ba1a1a; min-height: 20px; }
.hidden { display: none !important; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { max-height: 45vh; } }
