/* 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; }
.color-success { color: #2fd4c0; }
.color-danger { color: #ff6b6b; }
.color-warn { color: #f0ad4e; }
.color-muted { color: #999; }
.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
   150px min slot; the dark block grows with content so the subtitle
   beside it never gets overlapped */
.logo {
  width: auto;
  min-width: 150px;
  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: 150px;
  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;
  width: 100%;
  text-align: left;
  padding: 8px 22px;
  font-size: 14px;
  font-family: inherit;
  color: #b8c7ce;
  text-decoration: none;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
}
.sidebar-menu .tab-link:hover { background: #1a2226; color: #fff; }
.sidebar-menu .tab-link.active {
  background: #0a8b7d;
  color: #fff;
  border-left-color: #2fd4c0;
  font-weight: bold;
}

/* ================= content ================= */
.content-wrapper { margin-left: 150px; 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 3px; }

/* ================= 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; }

/* one-shot page feature tip (sidebar menu .data-tip) */
.page-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -12px);
  max-width: 520px;
  width: calc(100% - 40px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-left: 4px solid #1e88e5;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(20, 40, 70, .14);
  padding: 10px 12px;
  font-size: 13px;
  color: #2c3e50;
  z-index: 2000;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  box-sizing: border-box;
}
.page-toast.pt-show { opacity: 1; transform: translate(-50%, 0); }
.page-toast.pt-out { opacity: 0; transform: translate(-50%, -12px); }
.page-toast .pt-text { flex: 1; line-height: 1.5; }
.page-toast .pt-close {
  flex: none;
  border: none;
  background: transparent;
  color: #9aa7b4;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.page-toast .pt-close:hover { color: #5a6b7b; }
.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: 32px; 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; }
/* SIM expiry within 6 months (180 days) - rendered in red */
.exp-soon { color: #d9534f; font-weight: 600; }

/* ================= 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; }

/* module badges: one colour per module, kept distinct from role colours */
.mod-dtu { background: #0e7490; }
.mod-cors { background: #6d28d9; }
.mod-sim { background: #b45309; }

/* 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: 8px 12px;
}
.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: 20px; font-weight: bold; color: #2c3e50; }
.stat-label { font-size: 12px; color: #999; margin-top: 2px; }
.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; width: 1%; }

/* 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: wrap; gap: 2px 16px; font-size: 12px;
  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: 8px; flex-wrap: wrap; margin-bottom: 8px; }
/* ops page has exactly 3 cards — drop the 130px min-width floor so they
   share one row even on phones (sim page keeps the default wrap for 5) */
.stat-cards-row .stat-card { min-width: 0; }
.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; table-layout: fixed; }
.log-pane .stream-table th, .log-pane .stream-table td { padding: 2px 2px; }
/* one-line timestamps (yy-mm-dd hh:mm:ss) and snug column gaps:
   col widths fit the measured text at 13px YaHei (113px ts;
   41.2px widest "↑ trace" / 36.4px "↓ 下发" + 4px cell padding)
   nowrap keeps the arrow+text on one line at the break-opportunity space */
.log-pane .stream-table .col-ts { width: 117px; }
.log-pane .stream-table .col-dir { width: 46px; }
.log-pane .stream-table td:first-child { white-space: nowrap; }
/* direction tds render without the col-dir class (the class is on the th
   only); scope nowrap to the command table's 2nd cell. The trace table has
   just 2 columns so it must not be matched */
.log-side-pane .stream-table td:nth-child(2) { 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 4px 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; }
/* tight 4px side padding keeps the card seams slim (4+2 borders+4=10px)
   instead of wide white gutters beside the middle send-data card */
.detail-cols .box-body { padding: 8px 4px; }
.detail-cols .box-body.no-padding { padding: 0; }
/* fill the viewport: the detail main is a flex column, the device card
   takes its natural height and the three-column grid grabs the rest.
   A definite grid height makes the single auto row stretch, so the
   middle/right log panes grow with the window instead of leaving a big
   empty gap below the short left-column content */
#view-detail { display: flex; flex-direction: column; min-height: calc(100vh - 40px); }
#view-detail > .detail-cols { flex: 1 1 auto; min-height: 460px; }
/* left stack: param box absorbs the leftover (white surface, no gray
   hole); its content stays top-aligned */
.detail-cols > .col-stack > .box:first-child { flex: 1 1 auto; min-height: 0; }
.detail-cols > .col-stack > .box:first-child .box-body { display: flex; flex-direction: column; }
.detail-cols > .col-stack > .box:first-child #cfg-panes { flex: 0 0 auto; }
@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; }
  /* undo viewport fill: stacked sections size naturally, no forced stretch */
  #view-detail { display: block; min-height: 0; }
  #view-detail > .detail-cols { flex: none; min-height: 0; }
  .detail-cols > .col-stack > .box:first-child { flex: none; }
  .detail-cols > .col-stack > .box:first-child .box-body { display: block; }
  /* stacked flow: cap the two log streams (desktop rules set
     max-height:none because the columns are height-locked there).
     Without a cap the scroll area grows with every appended line;
     with it, extra rows scroll inside a fixed-height pane */
  .log-side-pane .log-pane-scroll { max-height: 280px; }
  .detail-cols > .box:last-child .log-pane-scroll { max-height: 600px; }
}
/* 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: 6px; margin: 4px 0; flex-wrap: nowrap; }
.cfg-row.qry-period { flex-wrap: nowrap; }
.cfg-row .cfg-ctl .qry-range-hint { margin: 0 0 0 6px; font-size: 12px; color: #8a99a6; white-space: nowrap; line-height: 1; flex-shrink: 0; }
.cfg-row > .cfg-label { width: 74px; flex: none; text-align: left; color: #5a6b7b; font-size: 13px; }
/* 4-char labels (主中心0：) — tight slot, pulls the controls to the left;
   nowrap guarantees the 4 glyphs never wrap to 2 lines */
.cfg-row > .cfg-label.lab-narrow { width: 62px; white-space: nowrap; }
.cfg-row > .cfg-label.lab-qry { width: 84px; white-space: nowrap; }
.cfg-row .cfg-ctl { display: flex; align-items: center; gap: 4px; 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 1px;
  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; }
/* compact select: short option lists (0-POST / 0-不输出), space goes to the
   w-flex sibling */
.cfg-row select.w-xs { width: 92px; }
.cfg-row select.w-lg { width: 250px; }
/* flex-grow controls: fill all free space in the control strip so long
   domains/paths stay visible (中心地址 IP/域名, HTTP /path, 内容类型, 自定义头) */
.cfg-row input.w-flex, .cfg-row select.w-flex { flex: 1 1 auto; width: auto; min-width: 140px; }
.cfg-row textarea.w-flex {
  flex: 1 1 auto; width: auto; min-width: 140px;
  height: 46px; padding: 4px 8px; resize: vertical;
  border: 1px solid #d5dde6; border-radius: 4px; font-size: 13px;
  color: #2c3e50; background: #f8fafc; font-family: inherit;
}
.cfg-row textarea.w-flex:focus { outline: none; border-color: #2f6fed; background: #fff; }
/* rows without set/query buttons (HTTP 内容类型/自定义头): reserve the
   same right footprint the two buttons occupy on the 请求方式 row, so
   their inputs end at the 设置 button's left edge — aligned with the
   /path input above, not at the row's right edge.
   6(row gap) + 50(设置) + 6(gap) + 50(查询) = 112px; button geometry is
   fixed by .cfg-btn (padding 0 11px, 2 glyphs at 13px) */
.cfg-row.row-btn-indent { margin-right: 112px; }
.cfg-btn {
  height: 30px; padding: 0 11px; 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 0 8px; margin: 10px 0; }
.cfg-sub-title { font-size: 13px; font-weight: 600; color: #2f6fed; margin: 6px 0 2px; padding: 0 12px; }
/* 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: 4px 8px;
                flex-wrap: wrap; max-width: 100%;
                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; }
/* card detail info groups: 属性表两列——第 1 列属性名（自动对齐到统一
   宽度），第 2 列属性值，一行一个属性；长值在值列内自动折行。
   字段 div 用 display:contents，让 label/值直接进入网格成两列 */
.sim-detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  font-size: 12px;
}
/* 分区标题 / 用量条 / 操作按钮行独占整行 */
.sim-detail-grid .dev-group-title,
.sim-detail-grid .sim-actions-inline,
.sim-detail-grid .sim-bar-row { grid-column: 1 / -1; }
.sim-detail-grid > div:not(.dev-group-title):not(.sim-actions-inline):not(.sim-bar-row) {
  display: contents;
}
.sim-detail-grid > div > label {
  color: #8a99a6; padding: 4px 20px 4px 0; white-space: nowrap;
  border-bottom: 1px dashed #e8eef2;
}
.sim-detail-grid > div > span {
  color: #2c3e50; word-break: break-all; padding: 4px 0;
  border-bottom: 1px dashed #e8eef2;
}
/* 值 + 行内按钮成组（机卡分离行） */
.sim-detail-grid .d-sep-cell { display: inline-flex; align-items: center; gap: 6px; }
/* compact card list: tighter cell padding than the default data-table, but
   keep width:100% like every other list so the style stays uniform */
.sim-table { min-width: 0; }
.sim-table th, .sim-table td { padding: 5px 5px; white-space: nowrap; }
/* device column: one IMEI per line, compact */
.sim-table .cell-devs div { line-height: 1.4; 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; }
/* shrink-to-fit the table instead of stretching it to the box:
   width:100%/min-width:1560 made it wider than the columns' content,
   and the auto-layout algorithm spread the surplus as big gaps between
   columns. width:auto lets each column hug its content (the 17 nowrap
   columns still force horizontal scrolling when the viewport is narrow) */
.ops-dev-table { min-width: 0; width: auto; }
.ops-dev-table th, .ops-dev-table td { padding: 3px 3px; 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: 28px; 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; }

  /* device detail breadcrumb: let the IMEI / ICCID / sim badge block take
     its own full-width row and wrap inside it instead of overflowing the
     phone screen (desktop keeps the single inline-flex row) */
  .breadcrumb-bar b > #crumb-detail { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; }
  .crumb-detail #crumb-iccid { min-width: 0; }
  .crumb-detail #info-iccid,
  .crumb-detail #info-iccid a { word-break: break-all; }

  /* server/status grid: wrap items into normal rows on phones instead of
     the desktop nowrap + horizontal-scroll strip; long svr hosts break in
     place, and the group title occupies its own line for clear hierarchy */
  .dev-info-grid { flex-wrap: wrap; overflow-x: visible; }
  .dev-info-grid > div { white-space: normal; }
  .dev-info-grid .dev-group-title { flex: 1 1 100%; }
  .dev-info-grid span { word-break: break-all; }

  /* box headers can pack many controls (title + search + status filter +
     owner filter + action buttons): let them wrap into rows on phones
     instead of forcing the page wider than the screen */
  .box-header { flex-wrap: wrap; row-gap: 4px; }
  .box-header .box-search { max-width: 100%; }

  /* /sim filter button cluster: wrap its buttons inside the group */
  .filter-btns { display: flex; flex-wrap: wrap; gap: 4px; }

  /* long inline code snippets in docs break in place instead of
     overflowing (code inside <pre> keeps the pre's own scroll) */
  .box-body code { white-space: normal; word-break: break-all; }

  /* account brand field: file input + hint share the field; let the hint
     take its own line aligned under the input */
  .brand-field { flex-wrap: wrap; }
  .brand-field .muted { flex: 1 1 100%; padding-left: 70px; }
}

/* ===== 批次定价矩阵视图（浅色高对比，与平台 AdminLTE 统一） ===== */
.price-matrix { width: 100%; overflow-x: auto; }
.price-matrix-table {
  width: 100%; min-width: 680px; table-layout: fixed;
  border-collapse: collapse; background: #fff;
}
.price-matrix-table th, .price-matrix-table td {
  text-align: center; padding: 9px 8px; border: 1px solid #d5dee8;
  vertical-align: middle; word-break: break-word;
}
/* 首列套餐定宽，其余列等宽均分 */
.price-matrix-table th:first-child, .price-matrix-table .plan-cell { width: 128px; }
.price-matrix-table thead th {
  font-size: 14px; font-weight: 600; letter-spacing: .3px;
  color: #fff; background: #0f766e;
  padding-top: 11px; padding-bottom: 11px; white-space: nowrap;
}
.price-matrix-table .plan-cell {
  text-align: left; white-space: nowrap; color: #1f2d3d;
  font-size: 15px; font-weight: 600; background: #eef5f4;
}
.price-matrix-table .empty-cell { background: #f4f7fa; }
.matrix-cell { cursor: pointer; transition: background .15s; }
.matrix-cell:hover { background: #dff3f0; }
.cell-price {
  font-size: 18px; font-weight: 700; color: #0f766e;
  line-height: 1.2; white-space: nowrap;
}
.seg-badge {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 6px; border-radius: 9px; margin-right: 5px;
  vertical-align: middle; background: #edf1f5; color: #6b7c8e; border: 1px solid #d2dce6;
}
.seg-badge.seg-multi { background: #0f766e; color: #fff; border-color: #0f766e; }
.cell-sub { font-size: 12px; margin-top: 2px; line-height: 1.4; }
.cell-dot { font-size: 12px; margin-top: 3px; color: #53647a; white-space: nowrap; }
.dot-active, .dot-inactive { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.dot-active { background: #22a35a; box-shadow: 0 0 4px rgba(34,163,90,.6); }
.dot-inactive { background: #f09018; }
/* 矩阵首行/首列 sticky */
.price-matrix-table .matrix-sticky-h,
.price-matrix-table .matrix-sticky-c {
  position: sticky; left: 0; z-index: 2; background: #eef5f4;
}
.price-matrix-table .matrix-sticky-h { z-index: 3; background: #0f766e; }
.btn-active { background: #2f6fed !important; color: #fff !important; border-color: #2f6fed !important; }

/* 浅色容器内：盈亏色加深，保证白底可读 */
.price-matrix-table .color-success,
.rule-hist-table .color-success,
#rules-list-wrap .color-success { color: #1f9d55; font-weight: 600; }
.price-matrix-table .color-danger,
.rule-hist-table .color-danger,
#rules-list-wrap .color-danger { color: #dc3545; font-weight: 600; }
/* 购买价统一暖色（所有表格/弹窗通用） */
.v-cost { color: #dd7d00; font-weight: 600; }

/* ===== 弹窗面板（浅色） ===== */
.modal-panel {
  background: #fff; border: 1px solid #d5dee8; border-radius: 10px;
  padding: 20px; max-width: 94vw; max-height: 90vh; overflow: auto;
  box-shadow: 0 18px 50px rgba(25,45,70,.28);
}
.modal-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #e3eaf2;
}
.modal-panel-title {
  color: #1f2d3d; font-size: 15px; line-height: 1.2; font-weight: 700;
  padding-left: 9px; border-left: 3px solid #0f766e;
}
.modal-close {
  background: none; border: none; color: #8a98a8; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: #1f2d3d; }

/* ===== 编辑表单（浅色） ===== */
.rule-field { flex: 1; min-width: 0; margin-bottom: 10px; }
.rule-field-row { display: flex; gap: 10px; }
.field-years { flex: 0 0 92px; }
.rule-label { display: block; font-size: 12px; color: #53647a; margin-bottom: 4px; }
.rule-input {
  width: 100%; box-sizing: border-box; padding: 7px 9px;
  background: #fff; border: 1px solid #c6d2df; border-radius: 5px;
  color: #1f2d3d; font-size: 13px; color-scheme: light;
}
.rule-input::placeholder { color: #93a3b5; }
.rule-input:focus {
  outline: none; border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15,118,110,.15);
}
/* 年限锁定（从指定年限矩阵格进入时） */
.rule-input:disabled {
  background: #eef1f5; color: #6b7c8e; cursor: not-allowed; opacity: 1;
}
.years-lock-hint {
  font-size: 10px; font-weight: 600; line-height: 1;
  color: #0f766e; border: 1px solid rgba(15,118,110,.5);
  border-radius: 3px; padding: 2px 4px; margin-left: 5px; vertical-align: middle;
}
.rule-error-text { color: #dc3545; font-size: 12px; margin-bottom: 8px; }
.rule-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ===== 调价历史表格（浅色） ===== */
.rule-hist-table {
  width: 100%; table-layout: fixed; border-collapse: collapse;
  font-size: 13px;
}
.rule-hist-table th, .rule-hist-table td {
  text-align: center; padding: 9px 6px; border-bottom: 1px solid #e1e8f0;
  vertical-align: middle; word-break: break-word;
}
.rule-hist-table th {
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: #edf2f7; color: #3c4f66;
}
.rule-hist-table .hist-date { text-align: left; white-space: nowrap; font-size: 12.5px; color: #33475b; }
.rule-hist-table .hist-price { color: #1f2d3d; font-weight: 700; }
.hist-row { cursor: pointer; transition: background .15s; }
.hist-row:nth-child(even) { background: #f9fbfd; }
.hist-row:hover { background: #dff3f0; }
.hist-add-row { margin-top: 14px; }
/* 状态圆点（替代原状态列） */
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.st-success { background: #22a35a; box-shadow: 0 0 4px rgba(34,163,90,.6); }
.st-warn { background: #f09018; }
.st-muted { background: #a6b2bf; }
/* 行内编辑按钮：始终可见 */
.hist-edit-btn {
  background: #fff; color: #0f766e; border: 1px solid #0f766e;
  border-radius: 5px; padding: 3px 14px; font-size: 12px; cursor: pointer; line-height: 1.5;
}
.hist-edit-btn:hover { background: #0f766e; color: #fff; border-color: #0f766e; }

/* ===== 单卡特殊价弹窗（浅色） ===== */
.pri-panel {
  background: #fff; border-radius: 8px; padding: 20px;
  width: 420px; max-width: 90vw;
}
.pri-panel-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.pri-panel-title { color: #0f766e; font-size: 15px; }
.pri-panel-close {
  background: none; border: none; color: #93a3b5; cursor: pointer; font-size: 20px; line-height: 1;
}
.pri-panel-close:hover { color: #1f2d3d; }
.pri-iccid { margin-bottom: 12px; font-size: 13px; color: #53647a; font-family: Consolas, monospace; }
.pri-field { margin-bottom: 9px; flex: 1; min-width: 0; }
.pri-row { display: flex; gap: 8px; margin-bottom: 9px; }
.pri-label { display: block; font-size: 12px; color: #53647a; margin-bottom: 4px; }
.pri-input {
  width: 100%; padding: 6px 8px; background: #fff;
  border: 1px solid #c6d2df; border-radius: 4px; color: #1f2d3d;
  font-size: 13px; color-scheme: light;
}
.pri-input:focus {
  outline: none; border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15,118,110,.15);
}
.pri-hint { font-size: 11px; color: #8a98a8; margin-top: 3px; line-height: 1.4; }
.pri-error { color: #dc3545; font-size: 12px; margin-bottom: 8px; }
.pri-actions { text-align: right; }


/* SIM card list pagination bar */
.sim-pager { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid #e6ebf0; }
.sim-pager .pg-select { padding: 2px 6px; font-size: 12px; border: 1px solid #ccd5dd; border-radius: 3px; background: #fff; }
.sim-pager #pg-info { font-size: 12px; }
