/* Yeecom DTU IoT platform - AdminLTE style */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #ecf0f5;
  color: #333;
  font-size: 13px;
}
.muted { color: #999; font-weight: normal; font-size: 12px; }
.hidden { display: none !important; }
code { font-family: Consolas, monospace; }

/* ================= login page ================= */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 22%, rgba(13,139,125,.28), transparent 42%),
    radial-gradient(circle at 82% 72%, rgba(46,109,164,.25), transparent 46%),
    radial-gradient(circle at 50% 105%, rgba(13,139,125,.18), transparent 55%),
    #050e17;
  position: relative;
}
.login-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(120,220,210,.22) 1px, transparent 1.6px);
  background-size: 36px 36px;
  pointer-events: none;
}
.login-card {
  position: relative;
  background: rgba(7,20,28,.86);
  border: 1px solid rgba(47,212,192,.35);
  border-radius: 10px;
  padding: 34px 38px 28px;
  width: 400px;
  box-shadow: 0 0 36px rgba(13,139,125,.28), inset 0 0 24px rgba(13,139,125,.06);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 { font-size: 30px; color: #2fd4c0; letter-spacing: 2px; }
.login-brand p { color: #6fcfc2; font-size: 13px; font-style: italic; margin-top: 6px; letter-spacing: 1px; }
.login-error {
  background: rgba(217,83,79,.18);
  border: 1px solid rgba(217,83,79,.5);
  color: #ff9d99;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: center;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.wxbind-tip {
  color: #9aa4b2;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
  text-align: center;
}
.login-input {
  display: flex;
  align-items: stretch;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(120,220,210,.3);
  border-radius: 3px;
}
.login-input:focus-within { border-color: #2fd4c0; background: rgba(255,255,255,.13); }
.login-input .ico {
  width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2fd4c0;
  font-size: 22px;
  font-family: Georgia, serif;
}
.login-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
  padding: 11px 12px 11px 0;
  letter-spacing: 1px;
}
.login-input input::placeholder { color: rgba(255,255,255,.75); }
.login-captcha .captcha-q {
  padding: 0 12px;
  display: flex;
  align-items: center;
  color: #2fd4c0;
  font-size: 15px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.login-form button {
  background: #0a8b7d;
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 12px;
  font-size: 17px;
  cursor: pointer;
  letter-spacing: 8px;
  margin-top: 4px;
}
.login-form button:hover { background: #08766a; }

/* ================= top header ================= */
.main-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 40px;
  background: #22262e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}
/* width auto: brand text (default or per-account custom) may exceed the
   170px min slot; the dark block grows with content so the subtitle
   beside it never gets overlapped */
.logo {
  width: auto;
  min-width: 170px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 0 16px;
  color: #fff;
  background: #1d2128;
  flex-shrink: 0;
}
.logo svg { width: 30px; height: 30px; flex-shrink: 0; }
.logo .logo-img { width: 30px; height: 30px; flex-shrink: 0; object-fit: contain; border-radius: 4px; }
.logo .logo-txt { font-size: 13px; font-weight: bold; letter-spacing: 1px; line-height: 1.1; white-space: nowrap; }
/* subtitle moved out of the logo slot: sits on the dark header beside the logo;
   margin-right:auto keeps it left (next to the logo) instead of header center */
.main-header .logo-sub {
  font-size: 13px; color: #6fcfc2; letter-spacing: 2px; font-weight: normal;
  margin: 0 auto 0 10px; white-space: nowrap; flex: none;
}
.header-right { display: flex; align-items: center; gap: 12px; padding-right: 14px; color: #ccc; font-size: 13px; }
.header-right .divider { width: 1px; height: 18px; background: #3c424b; }
.header-right .me-name { color: #fff; }
.header-right .me-company { color: #ccc; white-space: nowrap; }
.logout-btn {
  background: #f23f49;
  color: #fff !important;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 13px;
}
.logout-btn:hover { background: #d92832; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-on { background: #2fd4c0; box-shadow: 0 0 5px #2fd4c0; }
.dot-off { background: #7f8c9b; }
.dot-bad { background: #e5484d; box-shadow: 0 0 5px #e5484d; }

/* ================= sidebar ================= */
.main-sidebar {
  position: fixed;
  top: 40px; left: 0; bottom: 0;
  width: 170px;
  background: #222d32;
  overflow-y: auto;
}
.user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #1a2226;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #0a8b7d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}
.user-panel .uname { color: #fff; font-size: 13px; }
.user-panel .urole { font-size: 11px; color: #8aa4af; margin-top: 2px; }
.sidebar-menu { list-style: none; padding: 4px 0; }
.sidebar-menu .tab {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 22px;
  font-size: 14px;
  cursor: pointer;
  color: #b8c7ce;
  border-left: 3px solid transparent;
}
.sidebar-menu .tab:hover { background: #1a2226; color: #fff; }
.sidebar-menu .tab.active {
  background: #0a8b7d;
  color: #fff;
  border-left-color: #2fd4c0;
  font-weight: bold;
}
.menu-sep {
  padding: 10px 22px 4px;
  font-size: 11px;
  color: #5d717b;
  letter-spacing: 2px;
}
.sidebar-menu .tab-link {
  display: block;
  padding: 8px 22px;
  font-size: 14px;
  color: #b8c7ce;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar-menu .tab-link:hover { background: #1a2226; color: #fff; }

/* ================= content ================= */
.content-wrapper { margin-left: 170px; padding-top: 40px; min-height: 100vh; }
.breadcrumb-bar {
  background: #f9f9f9;
  border-bottom: 1px solid #e5e5e5;
  padding: 8px 12px;
  font-size: 13px;
  color: #777;
}
.breadcrumb-bar b { color: #444; }
.content { padding: 10px 12px; }

/* ================= box card ================= */
.box {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 3px;
  margin-bottom: 10px;
}
.box-header {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
}
.box-header .box-icon { color: #0a8b7d; font-size: 16px; }
/* color emoji glyphs render taller than text chars at the same size */
.box-header .box-icon.emoji { font-size: 13px; }
.box-header #device-count { color: #666; font-weight: 500; font-size: 13px; }
.box-header #device-count .cnt-online { color: #3c763d; font-weight: 600; }
.box-header .spacer { flex: 1; }
.box-body { padding: 10px 12px; }
.box-body.no-padding { padding: 0; overflow-x: auto; }
.data-table { min-width: 900px; }

/* ================= filter ================= */
.filter-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.filter-item label { display: block; font-weight: normal; font-size: 13px; margin-bottom: 6px; color: #333; }
.filter-item input, .filter-item select {
  width: 220px;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 13px;
  background: #fff;
}
.filter-item input:focus, .filter-item select:focus { outline: none; border-color: #0a8b7d; }
.filter-btns { display: flex; gap: 10px; }

/* ================= buttons ================= */
.btn {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: #2e6da4; color: #fff; border-color: #2e6da4; }
.btn-primary:hover { background: #265f8a; border-color: #265f8a; }
.btn-teal { background: #0a8b7d; color: #fff; border-color: #0a8b7d; }
.btn-teal:hover { background: #08766a; }
.btn-default { background: #fff; color: #333; border-color: #ccc; }
.btn-default:hover { background: #f5f5f5; border-color: #adadad; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-xs { padding: 2px 9px; font-size: 12px; border-radius: 3px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ================= data table ================= */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  padding: 8px 10px;
  border-top: 1px solid #f0f0f0;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}
.data-table thead th {
  background: #f7f7f7;
  color: #333;
  font-weight: bold;
  border-top: none;
  border-bottom: 1px solid #e5e5e5;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: #f4f9f9; }
.data-table tbody tr.row-selected { background: #e6f4f2; }
.data-table tbody tr.row-selected:hover { background: #dcefed; }
.text-success { color: #3c763d; font-weight: bold; }
.text-danger { color: #a94442; font-weight: bold; }
.text-muted2 { color: #999; }
.row-idx { color: #999; width: 42px; text-align: center !important; }
.row-ops { white-space: nowrap; }
.op-link {
  border: none;
  background: none;
  color: #2e6da4;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  margin-left: 8px;
}
.op-link:first-child { margin-left: 0; }
.op-link:hover { text-decoration: underline; }
.op-link.danger { color: #d9534f; }
.op-link.warn { color: #e08e0b; }

/* ================= role badges ================= */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  color: #fff;
  line-height: 18px;
}
.role-admin { background: #d9534f; }
.role-dealer { background: #2e6da4; }
.role-user { background: #3c763d; }

/* feature-module checkboxes (users page add form / inline module edit) */
.mod-checks { display: flex; gap: 10px; align-items: center; min-height: 30px; }
.mod-check { display: inline-flex; gap: 3px; align-items: center; font-weight: 400; white-space: nowrap; }
.mod-check input[type="checkbox"] { margin: 0; flex: none; width: auto; }

/* per-account brand form (account settings page) */
.brand-row { display: flex; gap: 24px; align-items: flex-start; }
.brand-preview { flex: none; }
.brand-preview-box {
  display: flex; align-items: center; gap: 8px;
  height: 50px; padding: 0 16px; border-radius: 4px;
  background: #1d2128; color: #fff;
}
.brand-preview-box svg { width: 30px; height: 30px; flex-shrink: 0; }
.brand-preview-box img { width: 30px; height: 30px; flex-shrink: 0; object-fit: contain; border-radius: 4px; }
.brand-preview-box b { font-size: 19px; letter-spacing: 1px; white-space: nowrap; }
.brand-fields { display: flex; flex-direction: column; gap: 10px; }
.brand-field { display: flex; align-items: center; gap: 10px; }
.brand-field > label { width: 60px; flex: none; text-align: right; }
.brand-field input[type="text"] { width: 220px; }
.brand-btns { padding-left: 70px; }

/* ================= debug / stream ================= */
.topic-cell { font-size: 11px; color: #777; font-family: Consolas, monospace; word-break: break-all; }
.custom-subs { margin-top: 2px; font-size: 10px; color: #e69500; font-family: Consolas, monospace; }
.topic-tag {
  font-size: 11px; color: #0a8b7d; background: #e6f4f2;
  padding: 2px 7px; border-radius: 3px; font-family: Consolas, monospace;
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle; display: inline-block;
}
.box-header > * { min-width: 0; }
.stream-wrap { max-height: 340px; overflow: auto; }
.stream-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.stream-table th {
  position: sticky;
  top: 0;
  background: #f7f7f7;
  text-align: left;
  font-size: 12px;
  color: #555;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e5e5;
  z-index: 1;
  white-space: nowrap;
}
.stream-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #f2f2f2;
  font-size: 13px;
  vertical-align: top;
}
.payload-text { font-family: Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.payload-hex { color: #b26a00; }

/* pause state: paused button turns amber, stream area dims a little */
.btn-paused { color: #b26a00; border-color: #b26a00; font-weight: 600; }
.stream-paused { opacity: 0.55; }

/* demo account badge in the top bar (amber pill on dark header) */
.demo-banner {
  background: rgba(255, 213, 79, 0.14);
  border: 1px solid rgba(255, 213, 79, 0.4);
  color: #ffd666;
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.dir-up { color: #3c763d; font-weight: bold; }
.dir-down { color: #e08e0b; font-weight: bold; }
.stream-new td { background: #fff8e1; }
.stream-notice td {
  color: #b26a00; background: #fcf8e3; font-size: 12px; padding: 4px 8px;
}
.empty-hint, .empty-state { text-align: center; color: #999; padding: 38px 0; }
#stream-empty { text-align: center; color: #aaa; padding: 30px 0; }
#stream-empty.hide { display: none; }

.debug-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* send box */
.send-box { border-top: 1px solid #f0f0f0; padding: 14px 16px; }
.send-box label { font-size: 13px; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.send-templates { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tpl-btn {
  border: 1px solid #ccc; background: #fff; border-radius: 3px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; color: #555;
}
.tpl-btn:hover { color: #0a8b7d; border-color: #0a8b7d; background: #e6f4f2; }
.send-row { display: flex; gap: 10px; align-items: flex-start; }
.hex-toggle {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: #444; cursor: pointer;
  padding: 8px 0; white-space: nowrap; user-select: none;
}
.hex-toggle input { cursor: pointer; }
.send-qos {
  border: 1px solid #ccc; border-radius: 3px; padding: 7px 6px;
  font-size: 13px; cursor: pointer; color: #555; background: #fff;
}
#send-topic-select, #send-topic-input { min-width: 220px; flex: 1; }
#send-topic-input { cursor: text; }
.send-row textarea {
  flex: 2;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 8px 10px;
  font-family: Consolas, monospace;
  font-size: 13px;
  resize: vertical;
}
.send-row textarea:focus { outline: none; border-color: #0a8b7d; }

/* ================= users ================= */
.user-add-form { display: flex; gap: 10px; margin-bottom: 0; align-items: flex-end; flex-wrap: wrap; }
.user-add-form .f-item label { display: block; font-size: 12px; color: #666; margin-bottom: 5px; }
.user-add-form input, .user-add-form select {
  border: 1px solid #ccc; border-radius: 3px; padding: 6px 10px; font-size: 13px; background: #fff;
}
.user-add-form input { width: 180px; }
.user-add-form input:focus, .user-add-form select:focus { outline: none; border-color: #0a8b7d; }
.user-table select { border: 1px solid #ccc; border-radius: 3px; padding: 3px 6px; font-size: 12px; background: #fff; }
.role-legend { margin-top: 16px; color: #777; font-size: 13px; }
.role-legend p { margin-bottom: 6px; }
.role-legend .badge { margin-right: 8px; }

/* ================= broker stats ================= */
.broker-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card {
  flex: 1;
  min-width: 130px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-left: 3px solid #0a8b7d;
  border-radius: 3px;
  padding: 13px 14px;
}
.stat-card.c-blue { border-left-color: #2e6da4; }
.stat-card.c-green { border-left-color: #3c763d; }
.stat-card.c-orange { border-left-color: #e08e0b; }
.stat-card.c-red { border-left-color: #d9534f; }
.stat-card.c-purple { border-left-color: #8e44ad; }
.stat-num { font-size: 24px; font-weight: bold; color: #2c3e50; }
.stat-label { font-size: 12px; color: #999; margin-top: 4px; }
.section-title { font-size: 14px; color: #555; margin: 18px 0 10px; }
.section-title input {
  float: right;
  width: 220px;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: normal;
  margin-top: -4px;
}
.section-title input:focus { outline: none; border-color: #0a8b7d; }

/* device online but not subscribed to its down topic */
.sub-warn {
  display: inline-block; color: #b26a00; font-size: 11px; font-weight: 600;
  margin-top: 3px; cursor: help; white-space: nowrap;
}
.box-header .sub-warn {
  margin: 0 0 0 10px; padding: 2px 8px; border: 1px solid #f0c36d;
  background: #fcf8e3; border-radius: 10px; cursor: help; white-space: normal;
}
#debug-box .box-header { flex-wrap: wrap; row-gap: 6px; }

/* clientid modal + inline note editing */
.note-edit {
  font-size: 11px; margin-top: 2px; cursor: pointer;
  color: #9aa5ae; font-weight: 400;
}
.note-edit:hover { color: #0a8b7d; }
.note-input {
  width: 100%; min-width: 150px; box-sizing: border-box;
  font-size: 12px; padding: 2px 5px; margin-top: 2px;
  border: 1px solid #0a8b7d; border-radius: 3px;
}
/* search box embedded in a box header */
.box-header { display: flex; align-items: center; gap: 10px; }
.box-search {
  margin-left: auto; width: 200px; font-size: 12px;
  padding: 4px 9px; border: 1px solid #d5dde3; border-radius: 4px;
}
.box-search:focus { border-color: #0a8b7d; outline: none; }
/* device group rows (admin view: devices grouped by owner account) */
tr.group-row td {
  background: #eef2f5; font-weight: 600; font-size: 13px;
  color: #33424e; cursor: pointer; user-select: none;
}
tr.group-row:hover td { background: #e4eaef; }
tr.group-row .g-caret { display: inline-block; width: 14px; color: #5a6b78; }
tr.group-row .g-count { font-weight: 400; color: #7a8894; font-size: 12px; margin-left: 8px; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 28, 36, .55);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-dialog {
  background: #fff; border-radius: 5px; width: 760px; max-width: 100%;
  max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
}
.modal-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid #eee; font-size: 15px;
}
.modal-header .muted { font-size: 12px; margin-left: 4px; }
.modal-close {
  margin-left: auto; border: 0; background: none; font-size: 24px;
  line-height: 1; color: #999; cursor: pointer; padding: 0 4px;
}
.modal-close:hover { color: #d9534f; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.cid-table { min-width: 520px; margin-top: 12px; }
.cid-addbox {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed #e0e0e0;
}
.cid-addbox select, .cid-addbox input {
  height: 30px; padding: 0 8px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px;
}
#cid-value { width: 190px; }
#cid-end { width: 190px; margin-left: 4px; }
#cid-note { width: 150px; }

/* device add / owner-assign modal */
.dev-form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dev-form-row label { width: 92px; text-align: right; color: #555; font-size: 13px; flex: none; white-space: nowrap; }
.dev-form-row .req { color: #d9534f; }
.dev-form-row input, .dev-form-row select {
  flex: 1; height: 32px; padding: 0 8px; border: 1px solid #ccc;
  border-radius: 3px; font-size: 13px; min-width: 0;
}
.dev-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* shared form helpers (used by stacked-form on rover/mountpoint add forms) */
.form-actions { display: flex; gap: 8px; margin-top: 14px; }
.req { color: #d9534f; }
.full-width { width: 100%; }

/* ================= client detail modal ================= */
.modal {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(20, 28, 36, .55);
}
.modal-box {
  position: relative; background: #fff; border-radius: 5px;
  width: 600px; max-width: 92%; max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
}
.modal-box-lg { width: 720px; }
.modal-box .modal-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid #eee; font-size: 15px;
}
.modal-box .modal-title { font-weight: 600; }
.modal-box .modal-close {
  margin-left: auto; border: 0; background: none; font-size: 24px;
  line-height: 1; color: #999; cursor: pointer; padding: 0 4px;
}
.modal-box .modal-close:hover { color: #d9534f; }
.client-detail-table { width: 100%; border-collapse: collapse; }
.client-detail-table th {
  background: #f7f7f7; text-align: right; white-space: nowrap;
  padding: 8px 12px; font-size: 12px; color: #555; width: 130px;
  border-bottom: 1px solid #eef1f4;
}
.client-detail-table td {
  padding: 8px 12px; font-size: 13px; border-bottom: 1px solid #eef1f4;
}
.sub-list { list-style: none; padding: 0; margin: 0; }
.sub-list li { padding: 4px 0; }
.sub-list code {
  background: #f2f5f5; color: #0a6b60; padding: 2px 8px;
  border-radius: 3px; font-size: 12px;
}

/* ================= connection guide page ================= */
.doc-p { margin: 0 0 10px; font-size: 13px; color: #444; line-height: 1.8; }
.doc-p code, .doc-steps code, .doc-table code, .doc-faq code, .doc-note code {
  background: #f2f5f5; color: #0a6b60; padding: 1px 5px; border-radius: 3px; font-size: 12px;
}
.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.doc-table th, .doc-table td {
  border: 1px solid #e8e8e8; padding: 8px 12px; font-size: 13px; text-align: left;
  vertical-align: top; line-height: 1.6;
}
.doc-table th { background: #f7f7f7; color: #555; font-weight: 600; white-space: nowrap; }
.doc-code {
  background: #1f2a33; color: #d8e6e3; border-radius: 4px; padding: 12px 14px;
  font-family: Consolas, 'Courier New', monospace; font-size: 12.5px; line-height: 1.7;
  margin: 8px 0 12px; overflow-x: auto; white-space: pre;
}
.doc-steps { margin: 0; padding-left: 22px; font-size: 13px; color: #444; line-height: 1.9; }
.doc-steps li { margin-bottom: 6px; }
/* .doc-note now shares the unified .help-note style (see below) */
.doc-faq details {
  border: 1px solid #e8e8e8; border-radius: 3px; margin-bottom: 8px; background: #fcfcfc;
}
.doc-faq summary {
  cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 600; color: #2c3e50;
  list-style: none; user-select: none;
}
.doc-faq summary::-webkit-details-marker { display: none; }
.doc-faq summary::before { content: '▸ '; color: #0a8b7d; }
.doc-faq details[open] summary::before { content: '▾ '; }
.doc-faq details p {
  margin: 0; padding: 0 14px 12px 28px; font-size: 13px; color: #666; line-height: 1.8;
}

/* ================= GNSS / unified user management ================= */
.btn-success { background: #3c763d; color: #fff; border-color: #3c763d; }
.btn-success:hover { background: #336334; border-color: #336334; }
.btn-danger { background: #d9534f; color: #fff; border-color: #d9534f; }
.btn-danger:hover { background: #c9302c; border-color: #c9302c; }
.btn-secondary { background: #fff; color: #333; border-color: #ccc; }
.btn-secondary:hover { background: #f5f5f5; border-color: #adadad; }
.btn-info { background: #2e6da4; color: #fff; border-color: #2e6da4; }
.btn-info:hover { background: #265f8a; border-color: #265f8a; }
.btn-link { background: none; border: none; color: #2e6da4; cursor: pointer; padding: 0 4px; }
.btn-link:hover { text-decoration: underline; }

.badge-success { background: #3c763d; }
.badge-danger { background: #d9534f; }
.badge-secondary { background: #8a99a6; }
.badge-info { background: #2e6da4; }
.badge-warning { background: #e08e0b; }

/* inline edit rows and forms (users page + gnss list pages) */
.edit-row td { background: #f9fbfb; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.inline-form input, .inline-form select {
  border: 1px solid #ccc; border-radius: 3px; padding: 5px 8px; font-size: 13px; background: #fff;
}
.inline-form input:focus, .inline-form select:focus { outline: none; border-color: #0a8b7d; }
form.inline { display: inline; }
.modal-form { background: #f7fafa; border: 1px solid #e3ecec; border-radius: 4px; padding: 14px; margin-top: 12px; }
.stacked-form { display: flex; flex-direction: column; gap: 12px; }
.stacked-form label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.stacked-form input { border: 1px solid #ccc; border-radius: 3px; padding: 6px 10px; font-size: 13px; }
.stacked-form select { border: 1px solid #ccc; border-radius: 3px; padding: 6px 10px; font-size: 13px; background: #fff; }
.stacked-form input.full-width, .stacked-form select.full-width { width: 100%; }
.stacked-form input:focus { outline: none; border-color: #0a8b7d; }
.form-group { margin-bottom: 0; }
.checkbox-label { white-space: nowrap; font-size: 13px; }
.grant-fieldset { border: 1px solid #e3ecec; border-radius: 4px; margin-top: 12px; }
.grant-fieldset legend { font-size: 13px; color: #0a8b7d; padding: 0 6px; }

/* gnss tree lists (rover / mountpoint): group rows + device rows */
.group-header td { font-weight: 600; }
.group-header:hover { background: #e2eee2; }
.device-row td { background: #fbfbfb; }
.self-device td { background: #f2f8f7; }
tr.device-row:hover td, tr.edit-row:hover td { background: #f4f9f9; }
.data-table td.actions { white-space: nowrap; }

/* help-note replaces doc-note (consolidated, same visual language) */
.help-note, .doc-note {
  background: #f0f8f7; border: 1px solid #e3ecec; border-left: 3px solid #0a8b7d;
  border-radius: 3px; padding: 12px 14px; font-size: 13px; color: #444; line-height: 1.9;
}
.help-note code, .help-note b, .doc-note code, .doc-note b { color: #0a6b60; }

/* flash messages (server-rendered pages) */
.flash { padding: 10px 14px; border-radius: 3px; font-size: 13px; margin: 12px 18px 0; }
.flash-success { background: #dff0d8; color: #3c763d; border: 1px solid #d6e9c6; }
.flash-error { background: #f2dede; color: #a94442; border: 1px solid #ebccd1; }
.flash-info { background: #d9edf7; color: #2e6da4; border: 1px solid #bce8f1; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
  border: 1px solid #e8e8e8; padding: 8px 12px; font-size: 13px; text-align: left;
}
.info-table th { background: #f7f7f7; color: #555; font-weight: 600; white-space: nowrap; }

/* auth pages: success variant of the login message box */
.login-ok {
  background: rgba(47,212,192,.15); border: 1px solid rgba(47,212,192,.5); color: #9fe8dc;
  border-radius: 4px; padding: 8px 12px; font-size: 13px; margin-bottom: 14px; text-align: center;
}

.broker-table { border: 1px solid #f0f0f0; border-radius: 3px; }
.owner-select { width: auto; }

/* ================= utility classes ================= */
.text-center { text-align: center; }
.float-right { float: right; }
.modal-lg { max-width: 560px; }
.modal-sm { max-width: 440px; }
.input-narrow { width: 90px; }
.input-flex { flex: 1; min-width: 120px; }
.toggle-btn { padding: 0 6px; }
.mt-s { margin-top: 10px; }
.back-link { color: #7a8aa0; font-size: 13px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.form-width { max-width: 340px; }
.inline-edit { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.inline-edit input { padding: 4px 8px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; }
.label-col { width: 160px; }

/* ================= per-cell inline edit (list tables) ================= */
/* pencil button next to the display value toggles a mini form in place */
.cell-edit-btn { border: none; background: none; color: #8a99a6; cursor: pointer; font-size: 12px; padding: 0 2px; margin-left: 4px; vertical-align: middle; }
.cell-edit-btn:hover { color: #0a8b7d; }
.cell-edit-form { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-left: 8px; }
.cell-edit-form input[type="text"], .cell-edit-form select { padding: 4px 8px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; }

/* ================= credential info dialog (rover list) ================= */
.cred-box { background: #f5f7f9; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; line-height: 1.9; color: #333; }
.cred-box b { display: block; margin-bottom: 2px; font-size: 14px; }

/* ================= device remote operations (设备远程运维) ================= */
.badge-online { background: #2fd4c0; color: #fff; }
.badge-offline { background: #8a99a6; color: #fff; }
/* device info card: compact one-row layout, two group columns, inline label:value */
.dev-info-grid {
  display: flex; flex-wrap: nowrap; gap: 2px 16px; font-size: 12px;
  overflow-x: auto; align-items: baseline;
}
.dev-info-grid > div { flex: none; white-space: nowrap; }
.dev-info-grid .dev-group-title { margin: 0; }
.dev-info-grid label { color: #8a99a6; margin-right: 4px; }
.dev-info-grid span { color: #2c3e50; }
/* compact single-row device id line (ICCID / DTUID) */
.dev-id-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 12px; margin: 0 0 6px; }
.dev-id-row .dev-id-item { display: inline-flex; align-items: baseline; min-width: 0; }
.dev-id-row label { color: #8a99a6; margin-right: 4px; flex: none; }
.dev-id-row .dev-id-item > span { color: #2c3e50; word-break: break-all; }
.dev-info-group + .dev-info-group { margin-top: 6px; }
/* AT command row layout */
.ops-cmd-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.ops-cmd-row .muted { font-size: 12px; }
#cmd-input { border: 1px solid #ccc; border-radius: 4px; padding: 6px 10px; font-size: 13px; }
#cmd-input:focus { outline: none; border-color: #0a8b7d; }
/* real-time log panel rows */
.log-row td { font-size: 12.5px; vertical-align: top; }
.log-row pre { margin: 0; white-space: pre-wrap; word-break: break-all; font-family: Consolas, 'Courier New', monospace; font-size: 12.5px; }
.log-trace td { background: #fbf9f0; }
.log-trace .log-data pre { color: #6b5d1f; }
.log-response .log-data pre { color: #1f6b3c; }
.log-command .log-data pre { color: #0a6; font-weight: 600; }
.log-message .log-data pre { color: #444; }
/* list stat cards (total/online/offline, click to filter) */
.stat-cards { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.stat-card.clickable { cursor: pointer; transition: box-shadow .15s, background .15s; }
.stat-card.clickable:hover { box-shadow: 0 2px 10px rgba(10,139,125,.18); }
.stat-card.c-online { border-left-color: #2fd4c0; }
.stat-card.c-offline { border-left-color: #7f8c9b; }
.stat-card.active { background: #e6f4f2; box-shadow: 0 0 0 1px #0a8b7d inset; }
/* whole-row clickable device table rows */
tr.device-row { cursor: pointer; }
/* grouped detail info sections */
.dev-group-title { font-size: 12px; font-weight: 600; color: #0a8b7d; margin: 0 0 4px; }
/* auth/online meta shown after the "服务器 / 状态" group title */
.dev-group-title .dev-group-meta { font-weight: normal; color: #5a6b7b;
                                   font-size: 12px; margin-left: 6px; }
/* visual config downlink form */
.ops-config-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.ops-config-form select, .ops-config-form input {
  border: 1px solid #ccc; border-radius: 4px; padding: 6px 10px; font-size: 13px; background: #fff;
}
.ops-config-form select { max-width: 320px; }
.ops-config-form input { width: 240px; }
.ops-config-form select:focus, .ops-config-form input:focus { outline: none; border-color: #0a8b7d; }
/* config readback table */
.cfg-table .cfg-val { font-family: Consolas, 'Courier New', monospace; word-break: break-all; color: #0a6b5f; }
/* dangerous quick action */
.btn-danger { background: #d9534f; color: #fff; border-color: #d9534f; }
.btn-danger:hover { background: #c9302c; border-color: #c9302c; }
.ops-cmd-preview { margin: 4px 0 8px; font-size: 13px; }
.ops-cmd-preview code {
  background: #f5f7f9; border: 1px solid #e3e9ee; border-radius: 4px;
  padding: 3px 8px; color: #0a6b5f; font-size: 12.5px;
}
/* log panes: trace fills the right column, cmd pane sits in the middle column */
.log-dual { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 4px; }
.log-pane { border: 1px solid #e4eaf2; border-radius: 8px; min-width: 0; display: flex; flex-direction: column; }
.log-pane-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 3px 6px;
  background: #f8fafd; border-bottom: 1px solid #e4eaf2;
}
.log-pane-title { font-size: 13px; font-weight: 600; color: #2f6fed; }
.log-pane-scroll { max-height: 560px; }
/* right column: height locked to the grid row (set by the left column only) via
   height:0 (contributes nothing to row sizing) + min-height:100% (stretches to the row);
   log content never grows the box, it scrolls inside */
.detail-cols > .box:last-child { display: flex; flex-direction: column; height: 0; min-height: 100%; overflow: hidden; }
.detail-cols > .box:last-child .box-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.detail-cols > .box:last-child .log-dual { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.detail-cols > .box:last-child .log-pane { flex: 1; min-height: 0; }
.detail-cols > .box:last-child .log-pane-scroll { flex: 1; max-height: none; height: auto; min-height: 200px; }
/* left column stack: param config box + quick load/config box */
.col-stack { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
/* quick load/config: 2x2 grid, medium-width buttons centered */
.col-stack .cfg-qgrid { grid-template-columns: repeat(2, 150px); gap: 4px; justify-content: center; }
/* middle column: same height-lock trick, cmd pane fills leftover space, bottom aligned */
.detail-cols > .box:nth-child(2) { display: flex; flex-direction: column; height: 0; min-height: 100%; overflow: hidden; }
.detail-cols > .box:nth-child(2) .box-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.detail-cols .cfg-side { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.log-side-pane { margin-top: 1px; flex: 1; min-height: 0; }
.log-side-pane .log-pane-scroll { flex: 1; max-height: none; height: auto; min-height: 150px; }
.log-pane .stream-table { min-width: 0; }
.log-pane .stream-table th, .log-pane .stream-table td { padding: 2px 3px; }
/* one-line timestamps (yy-mm-dd hh:mm:ss) and minimal column gaps */
.log-pane .stream-table .col-ts { width: 126px; }
.log-pane .stream-table .col-dir { width: 52px; }
.log-pane .stream-table td:first-child { white-space: nowrap; }
.log-pane .empty-hint { padding: 10px; }

/* ================= tabbed device parameter config ================= */
/* device card (compact header row + collapsible detail) */
.dev-card { border-left: 3px solid #2f6fed; }
.dev-card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 14px;
}
.dev-card-left { display: flex; align-items: center; gap: 10px; }
.dev-card-title {
  font-size: 16px; font-weight: 600; color: #1b3a5c;
  font-family: Consolas, 'Courier New', monospace; letter-spacing: 0.5px;
}
.dev-card-sub { color: #8a99a6; font-size: 13px; }
.dev-card-meta { color: #5a6b7b; font-size: 13px; }
.dev-card-detail { border-top: 1px solid #edf1f6; padding: 10px 16px 8px; }
/* unified command bar at bottom of log box */
.cmd-bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px;
  border-top: 1px solid #e3e9ef; background: #f7faff;
}
.cmd-bar input[type=text] {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px;
  border: 1px solid #cdd9ea; border-radius: 4px; font-size: 13px;
  font-family: Consolas, 'Courier New', monospace;
  background: #fff; color: #2c3e50;
}
.cmd-bar input[type=text]:focus { outline: none; border-color: #2f6fed; }

.cfg-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 9px 14px; margin-bottom: 0;
  border-bottom: 1px solid #e3e9ef;
  background: #f7faff;
}
.cfg-toolbar .cfg-btn { height: 32px; padding: 0 12px; font-size: 13px; }
.cfg-btn-primary {
  background: #2f6fed; border: 1px solid #2f6fed; color: #fff;
  font-weight: 600; padding: 0 18px !important;
}
.cfg-btn-primary:hover { background: #1f5fd8; border-color: #1f5fd8; }
.cfg-toolbar-sep {
  width: 1px; height: 22px; background: #cdd9ea; margin: 0 4px; flex: none;
}
/* three-column detail layout: params / quick ops / live logs (seamless) */
.detail-cols {
  display: grid;
  grid-template-columns: minmax(430px, 1.25fr) minmax(300px, 1fr) minmax(340px, 1.2fr);
  gap: 0; align-items: stretch;
}
.detail-cols .box { margin-bottom: 0; }
.detail-cols .box-body { padding: 8px; }
.detail-cols .box-body.no-padding { padding: 0; }
@media (max-width: 1399px) {
  .detail-cols { grid-template-columns: 1fr; gap: 14px; }
  /* single-column stacking: undo the height-lock so boxes size to their content */
  .detail-cols > .box:nth-child(2), .detail-cols > .box:last-child { height: auto; min-height: 0; }
}
/* main tabs */
/* single-row tabs: equal width, tight 1px gaps, tinted blocks */
.cfg-tabs { display: flex; gap: 1px; border-bottom: 1px solid #c9d6e4; flex-wrap: nowrap; }
.cfg-tab {
  flex: 1; text-align: center; white-space: nowrap;
  padding: 5px 2px; font-size: 13px; color: #5a6b7b; cursor: pointer; user-select: none;
  border: 1px solid #dbe5ef; border-bottom: none; border-radius: 6px 6px 0 0;
  background: #f4f7fb;
}
.cfg-tab:hover { color: #2f6fed; background: #e8f1ff; }
.cfg-tab.active { background: #2f6fed; color: #fff; border-color: #2f6fed; font-weight: 600; }
.cfg-pane { display: none; padding-top: 4px; }
.cfg-pane.active { display: block; }
/* param box (left column stack): minimal vertical gaps header -> tabs -> form */
.col-stack .box .box-header { padding-bottom: 5px; }
.col-stack .box .box-body { padding-top: 3px; }
/* channel sub-tabs (中心地址 SERVER0-5) */
.cfg-tip { color: #3c8dbc; font-size: 12px; margin: -2px 0 6px; }
.cfg-ctl input:disabled, .cfg-ctl select:disabled,
.qry-table input:disabled, .qry-table select:disabled {
  background: #f2f4f7; color: #aab; cursor: not-allowed;
}
.cfg-btn:disabled { opacity: .5; cursor: not-allowed; }
.rinfo-val { font-weight: 600; color: #333; }
.cfg-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cfg-subtab {
  padding: 3px 12px; font-size: 13px; cursor: pointer; border-radius: 4px;
  border: 1px solid #cdd9ea; background: #f5f8fd; color: #3a5578;
}
.cfg-subtab:hover { border-color: #2f6fed; color: #2f6fed; }
.cfg-subtab.active { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.cfg-subpane { display: none; }
.cfg-subpane.active { display: block; }
/* parameter row: label (fixed right aligned) + controls + set/query */
.cfg-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: nowrap; }
.cfg-row > .cfg-label { width: 74px; flex: none; text-align: left; color: #5a6b7b; font-size: 13px; }
.cfg-row .cfg-ctl { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; flex-wrap: nowrap; }
.cfg-row > .cfg-btn, .cfg-row .cfg-ctl > label { flex: none; }
.cfg-row .cfg-ctl > span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cfg-row input[type=text], .cfg-row input:not([type]), .cfg-row select {
  height: 30px; border: 1px solid #d5dde6; border-radius: 4px; padding: 0 8px;
  font-size: 13px; color: #2c3e50; background: #f8fafc; min-width: 0;
}
.cfg-row input:focus, .cfg-row select:focus { outline: none; border-color: #2f6fed; background: #fff; }
.cfg-row input.w-sm { width: 70px; } .cfg-row input.w-md { width: 150px; }
.cfg-row textarea.w-lg {
  width: 240px; height: 46px; padding: 4px 8px; resize: vertical;
  border: 1px solid #d5dde6; border-radius: 4px; font-size: 13px;
  color: #2c3e50; background: #f8fafc; font-family: inherit; min-width: 0;
}
.cfg-row textarea.w-lg:focus { outline: none; border-color: #2f6fed; background: #fff; }
.cfg-row input.w-lg { width: 240px; } .cfg-row select.w-sm { width: 130px; }
.cfg-row select.w-md { width: 180px; }
.cfg-row select.w-lg { width: 250px; }
.cfg-btn {
  height: 30px; padding: 0 14px; font-size: 13px; border-radius: 4px;
  cursor: pointer; white-space: nowrap;
}
.cfg-btn-set { background: #2f6fed; border: 1px solid #2f6fed; color: #fff; }
.cfg-btn-set:hover { background: #1f5fd8; border-color: #1f5fd8; }
.cfg-btn-qry { background: #fff; border: 1px solid #2f6fed; color: #2f6fed; }
.cfg-btn-qry:hover { background: #eef4ff; }
/* section divider inside a pane (HTTP / MQTT sub blocks) */
.cfg-sub { border: 1px dashed #d8e2ef; border-radius: 6px; padding: 3px 12px 8px; margin: 10px 0; }
.cfg-sub-title { font-size: 13px; font-weight: 600; color: #2f6fed; margin: 6px 0 2px; }
/* right side panel */
.cfg-side-box { background: #f8fafd; border: 1px solid #e4eaf2; border-radius: 8px; padding: 5px 8px; margin-bottom: 1px; }
.cfg-side-title { font-size: 13px; font-weight: 600; color: #3a5578; margin-bottom: 2px; }
.cfg-quick-row { display: flex; gap: 8px; margin-bottom: 10px; }
.cfg-quick-row .cfg-btn { flex: 1; padding: 0; height: 32px; }
.cfg-qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.cfg-qgrid .cfg-btn { padding: 0; height: 32px; font-size: 12.5px; }
/* serial send / receive */
.cfg-serial-label { font-size: 13px; color: #2f6fed; margin: 0 0 1px; }
.cfg-textarea {
  width: 100%; box-sizing: border-box; border: 1px solid #d5dde6; border-radius: 4px;
  padding: 8px; font-size: 13px; resize: vertical; background: #fff; color: #2c3e50;
  font-family: Consolas, 'Courier New', monospace;
}
.cfg-textarea:focus { outline: none; border-color: #2f6fed; }
.cfg-serial-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1px; }
.cfg-hint { font-size: 12px; color: #8a99a6; margin-top: 6px; }
/* poll command table */
.qry-table { width: 100%; border-collapse: collapse; }
.qry-table th, .qry-table td { border: 1px solid #e3e9ef; padding: 5px 6px; font-size: 12.5px; }
.qry-table th { background: #f5f8fd; color: #5a6b7b; font-weight: 500; }
.qry-table input { width: 100%; box-sizing: border-box; height: 26px; border: 1px solid #d5dde6; border-radius: 3px; padding: 0 5px; font-size: 12px; }
.qry-table input:focus { outline: none; border-color: #2f6fed; }
.qry-table .cfg-btn { height: 26px; padding: 0 8px; font-size: 12px; }

/* ================= searchable select (combobox) ================= */
/* replaces long native <select data-searchable> lists (owner account
   pickers) with an input + dropdown so 100+ accounts stay findable */
.ss-wrap { position: relative; display: inline-block; vertical-align: middle; }
.ss-box { display: flex; align-items: center; border: 1px solid #d5dde3; border-radius: 4px; background: #fff; }
.ss-box:focus-within { border-color: #0a8b7d; }
.ss-input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 13px; padding: 6px 4px 6px 10px; color: #333; }
.ss-input::placeholder { color: #b6c2cc; }
.ss-caret { color: #8a99a6; font-size: 11px; padding-right: 8px; pointer-events: none; }
.ss-search { width: 14px; height: 14px; stroke: #8a99a6; stroke-width: 2; fill: none; margin-right: 6px; flex: none; }
/* fixed on <body> + JS-anchored: must not be clipped by modal-body's
   overflow-y:auto, so absolute positioning inside the wrap won't do */
.ss-list { position: fixed; z-index: 1100; background: #fff; border: 1px solid #d5dde3; border-radius: 4px; box-shadow: 0 6px 18px rgba(15,35,50,.12); max-height: 300px; overflow-y: auto; display: none; }
.ss-list.open { display: block; }
.ss-opt { padding: 7px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-opt:hover, .ss-opt.active { background: #eef6fb; }
.ss-opt.disabled { color: #8a99a6; cursor: default; }
.ss-opt.disabled:hover { background: none; }
.ss-empty { padding: 8px 10px; color: #8a99a6; font-size: 12px; }
/* context sizing: mirror the native selects the combobox replaces */
.box-header .ss-wrap { margin-left: auto; width: 200px; font-size: 12px; }
.box-header .ss-input { padding: 4px 4px 4px 9px; font-size: 12px; }
.filter-item .ss-wrap { width: 220px; }
.dev-form-row .ss-wrap { flex: 1; }
.dev-form-row .ss-box { height: 32px; }
.user-add-form .ss-wrap { width: 180px; }

/* ================= ops device detail: header info in the breadcrumb bar ================= */
.breadcrumb-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* the <b> wrapping the crumb block becomes a flex row so the spacer can
   push the back button to the right edge; items never shrink (no overlap),
   they wrap to the next line when out of space */
.breadcrumb-bar b { display: flex; align-items: center; gap: 8px;
                    flex-wrap: wrap; flex: 1; min-width: 0; }
.breadcrumb-bar b > span, .breadcrumb-bar b > button { flex: none; }
.breadcrumb-bar b .spacer { flex: 1 1 0; min-width: 8px; }
.crumb-detail { display: inline-flex; align-items: center; gap: 8px;
                margin-left: 4px; font-weight: normal; }
.crumb-detail .crumb-sep { color: #c3cdd7; }
.crumb-detail .crumb-item { color: #5a6b7b; font-weight: normal; }
.crumb-detail #detail-imei {
  font-family: Consolas, 'Courier New', monospace; font-weight: 600;
  color: #1b3a5c; }
.crumb-detail #info-iccid,
.crumb-detail #info-iccid a {
  font-family: Consolas, 'Courier New', monospace; }
/* dev-card head was merged into the breadcrumb bar: drop its top border and
   tighten the gap between the breadcrumb bar and the status row */
main#view-detail.content { padding-top: 4px; }
.dev-card > .dev-card-detail { border-top: none; padding-top: 6px; }
/* gap between the status card and the param columns matches the
   breadcrumb-bar-to-status gap above (both 4px) */
main#view-detail.content .dev-card { margin-bottom: 4px; }

/* ================= SIM card module (物联卡管理) ================= */
/* usage progress bar inside the card detail grid */
.sim-bar-row { display: flex; align-items: center; gap: 10px; }
.sim-bar { width: 140px; height: 8px; background: #e8eef0; border-radius: 4px;
           overflow: hidden; flex: none; }
.sim-bar > span { display: block; height: 100%; width: 0;
                  background: #2fd4c0; transition: width .3s; }
.sim-bar > span.warn { background: #e08e0b; }
.sim-bar > span.bad { background: #e5484d; }
.sim-actions-inline { display: flex; align-items: center; gap: 8px;
                      flex-wrap: wrap; margin-top: 4px; }
/* device column: one IMEI per line, compact */
.sim-table .cell-devs div { line-height: 1.5; white-space: nowrap; }
.sim-table .badge { display: inline-block; min-width: 44px; text-align: center; }
/* detail remark: click the span (or its pencil) to edit */
#d-remark { cursor: pointer; }
#d-remark .rm-input { width: 110px; }

/* ================= ops device list (17 columns) ================= */
/* wide table: horizontal scroll inside the box instead of clipping */
.table-scroll { overflow-x: auto; }
.ops-dev-table { min-width: 1560px; }
.ops-dev-table th, .ops-dev-table td { padding: 3px 4px; white-space: nowrap; }
.ops-dev-table thead th {
  background: #f5f8fd; color: #465a6e; font-weight: 600;
}
.ops-dev-table td.nowrap, .ops-dev-table th.nowrap { white-space: nowrap; }
.ops-dev-table .mono, .ops-dev-table td.cell-addr {
  font-family: Consolas, 'Courier New', monospace; font-size: 12.5px;
}
.ops-dev-table td.cell-addr, .ops-dev-table td.cell-group {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.ops-dev-table td.cell-remark, .sim-table td.cell-remark {
  max-width: 150px; white-space: nowrap; color: #465a6e;
}
.ops-dev-table td.cell-remark .rm-text, .sim-table td.cell-remark .rm-text {
  display: inline-block; max-width: 118px; vertical-align: bottom;
  overflow: hidden; text-overflow: ellipsis;
}
.cell-remark .rm-edit, .cell-remark .rm-save, .cell-remark .rm-cancel {
  border: none; background: none; cursor: pointer; padding: 0 1px;
  font-size: 12px; line-height: 1.4; color: #98a6b2;
}
.cell-remark .rm-edit:hover { color: #1a73c2; }
.cell-remark .rm-save { color: #2e9e5b; }
.cell-remark .rm-save:hover { color: #237a45; }
.cell-remark .rm-cancel { color: #d9534f; }
.cell-remark .rm-cancel:hover { color: #b03b37; }
.cell-remark .rm-input {
  width: 92px; font-size: 12.5px; padding: 1px 4px;
  border: 1px solid #b9c8d8; border-radius: 3px; outline: none;
}
.cell-remark .rm-input:focus { border-color: #1a73c2; }
.ops-dev-table .addr-line { white-space: nowrap; line-height: 1.5; }
.ops-dev-table .row-idx { width: 40px; color: #98a6b2; }
/* offline rows de-emphasised; online rows keep default color */
.ops-dev-table tr.row-offline { color: #9aa6b1; }
.ops-dev-table tr.row-offline a { color: #8fa4b8; }
.ops-dev-table tbody tr:hover { background: #f3f8ff; }

/* ================= mobile / phone =================
   One consolidated breakpoint for phones: the sidebar becomes a
   horizontal scrolling nav strip under the header; data tables already
   scroll horizontally inside their .box-body (min-width on .data-table).
   All desktop rules above stay untouched - add future phone tweaks here. */
@media (max-width: 768px) {
  /* header: shrink the brand block, drop the decorative subtitle and
     the long company name (username + role + logout stay) */
  .logo { min-width: 0; padding: 0 10px; }
  .main-header .logo-sub { display: none; }
  .header-right { gap: 8px; padding-right: 8px; }
  .header-right .me-company { display: none; }

  /* sidebar -> one-line horizontal nav below the 40px header */
  .main-sidebar {
    top: 40px; left: 0; right: 0; bottom: auto;
    width: auto; height: auto;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .user-panel { display: none; }      /* username is in the header already */
  .sidebar-menu { display: flex; padding: 0; margin: 0; white-space: nowrap; }
  .sidebar-menu li { flex: none; }
  .menu-sep { display: none; }
  .sidebar-menu .tab, .sidebar-menu .tab-link {
    padding: 11px 14px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .sidebar-menu .tab.active, .sidebar-menu .tab-link.active {
    border-bottom-color: #2fd4c0;
  }

  /* content starts below header + nav strip (40px + ~42px) */
  .content-wrapper { margin-left: 0; padding-top: 84px; }
  .content { padding: 8px; }
  .breadcrumb-bar { padding: 6px 8px; }

  /* filter forms: inputs grow to share a row, wrap on narrow screens */
  .filter-form { gap: 8px; }
  .filter-item { flex: 1 1 140px; }
  .filter-item input, .filter-item select { width: 100%; }

  /* parameter config rows (label + control + buttons) may wrap */
  .cfg-row { flex-wrap: wrap; }
  .brand-row { flex-direction: column; gap: 10px; }
}

