body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; margin: 20px; }
h1 { margin: 0 0 10px; }
table { border-collapse: collapse; width: 100%; margin-top: 12px; }
th, td { border: 1px solid #ddd; padding: 8px; font-size: 13px; }
th { background: #f7f7f7; text-align: left; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
input, button, select { padding: 8px; font-size: 13px; }
/* Chỉ ô dán frame HEX cần rộng; tránh kéo giãn form login */
#hex { min-width: min(100%, 420px); max-width: 100%; box-sizing: border-box; }
.muted { color: #666; font-size: 12px; }
.ok { color: #0a7a18; }
.err { color: #b00020; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
.flow-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.flow-rx-request { background: #e6f4ff; color: #0b4f8a; }
.flow-tx-response { background: #e9fbe9; color: #166534; }
.flow-tx-command { background: #fff6e5; color: #92400e; }
.flow-rx-response { background: #f3e8ff; color: #6b21a8; }
.flow-unknown { background: #f3f4f6; color: #374151; }

.conn-status-active {
  color: #15803d;
  font-weight: 600;
}
.conn-status-closed {
  color: #b91c1c;
  font-weight: 600;
}

.nav-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 12px;
  font-size: 13px;
}
.nav-toolbar__left,
.nav-toolbar__right {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.nav-toolbar__right {
  margin-left: auto;
}
.nav-toolbar button {
  padding: 4px 10px;
  font-size: 12px;
  vertical-align: baseline;
}

.action-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}
.action-group__label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.action-panel {
  display: flex;
  gap: 16px;
  align-items: stretch;
  margin-top: 16px;
}
.action-panel__left,
.action-panel__right {
  flex: 1 1 0;
  max-width: 50%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}
.action-panel__right {
  background: #f8fafc;
}
.action-panel__right h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.action-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.action-field input,
.action-field select {
  width: 100%;
  box-sizing: border-box;
}
.action-form {
  margin-top: 12px;
}
.action-panel__buttons {
  margin-top: 14px;
}
#actionSubmitBtn {
  width: 100%;
  font-weight: 600;
}
#hexPreview {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
}
.action-table-wrap {
  overflow-x: auto;
}
.action-form table {
  margin-top: 8px;
}
.action-form th,
.action-form td {
  padding: 6px;
}
.action-form input,
.action-form select {
  min-width: 120px;
}
@media (max-width: 900px) {
  .action-panel {
    flex-direction: column;
  }
  .action-panel__left,
  .action-panel__right {
    max-width: 100%;
  }
}
.meter-actions-cell .action-group {
  display: flex;
  margin-bottom: 6px;
}
.meter-actions-cell .action-group:last-child {
  margin-bottom: 0;
}
.meter-action--danger {
  border-color: #b91c1c;
  color: #b91c1c;
}
.meter-action--danger:hover {
  background: #fef2f2;
}

/* Trang đăng nhập: căn giữa màn hình + card */
.auth-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: linear-gradient(165deg, #eef2f6 0%, #dfe6ee 45%, #e8ecf1 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.08),
    0 12px 24px -4px rgba(15, 23, 42, 0.12);
  padding: 32px 28px;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.auth-card--inline {
  margin: 28px auto;
  max-width: 440px;
}
.auth-title {
  font-size: 1.35rem;
  margin: 0 0 6px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.auth-lead {
  margin: 0 0 22px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}
.auth-field input:focus {
  outline: none;
  border-color: #0d9488;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.22);
}
.auth-submit {
  margin-top: 4px;
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
}
.auth-submit:hover {
  background: #0d9488;
}
.auth-msg {
  min-height: 1.35em;
  margin-bottom: 14px;
  font-size: 13px;
}
