:root {
  --bg: #f9fafb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #4b5563;
  --faint: #98a2b3;
  --line: rgba(209, 213, 219, .72);
  --line-strong: rgba(156, 163, 175, .7);
  --blue: #14b8a6;
  --blue-2: #0d9488;
  --green: #0d9488;
  --red: #c2410c;
  --amber: #b45309;
  --cyan: #2dd4bf;
  --shadow: 0 20px 50px rgba(15, 23, 42, .08);
}

/* Broadband operator console skin: practical, dense, and less decorative. */
:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --text: #172033;
  --muted: #5d6678;
  --faint: #8a94a6;
  --line: #dde3ee;
  --line-strong: #c6cfdd;
  --blue: #1d4ed8;
  --blue-2: #1e40af;
  --green: #15803d;
  --red: #dc2626;
  --amber: #d97706;
  --cyan: #0ea5e9;
  --shadow: 0 8px 22px rgba(20, 31, 54, .08);
}

html,
body {
  background: var(--bg);
}

body {
  color: var(--text);
  background:
    linear-gradient(180deg, #f5f7fb 0%, #eef2f7 280px, #eef2f7 100%);
}

body::before,
body::after,
.topbar::before,
.panel::before,
.metric::before,
.toolbar::before {
  content: none !important;
  animation: none !important;
}

::-webkit-scrollbar-track {
  background: #e8edf5;
}

::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover {
  background: #aeb8c8;
  border-color: #e8edf5;
}

.sidebar {
  background: #14233f;
  color: #dbeafe;
  border-right: 1px solid #0f1a30;
  box-shadow: 8px 0 28px rgba(15, 23, 42, .16);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.brand {
  border-bottom-color: rgba(219,234,254,.14);
}

.brand-mark {
  background: #2563eb;
  color: #fff;
  box-shadow: none;
}

.brand strong {
  color: #fff;
}

.brand small,
.nav-group > span {
  color: #8fa6ca;
}

.nav-group > span {
  letter-spacing: 0;
}

.nav-item {
  color: #c9d7f0;
  border-radius: 6px;
  font-weight: 600;
}

.nav-item:hover {
  color: #fff;
  background: rgba(37, 99, 235, .18);
}

.nav-item.active {
  color: #fff;
  background: #2563eb;
  box-shadow: inset 3px 0 0 #93c5fd;
}

.main {
  width: min(1240px, calc(100% - 40px));
  padding-top: 24px;
}

.topbar,
.panel,
.metric,
.toolbar,
.workbench-card,
.loading-panel,
.mini-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.topbar {
  min-height: 92px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-top: 4px solid var(--blue);
}

h1 {
  font-size: 30px;
  line-height: 1.18;
}

h2 {
  font-size: 14px;
  font-weight: 800;
}

.topbar p {
  margin-top: 6px;
  font-size: 14px;
}

.user-pill {
  min-height: 34px;
  border-radius: 6px;
  background: #f8fafc;
}

.primary-btn,
.ghost-btn {
  min-height: 34px;
  border-radius: 5px;
  padding: 0 12px;
  font-size: 13px;
}

.primary-btn {
  background: var(--blue);
  border-color: var(--blue);
}

.primary-btn:hover {
  background: var(--blue-2);
  border-color: var(--blue-2);
}

.ghost-btn {
  background: #f8fafc;
  border-color: var(--line-strong);
}

.metrics {
  gap: 12px;
  margin-bottom: 12px;
}

.metric {
  min-height: 98px;
  padding: 16px;
  border-left: 4px solid var(--blue);
}

.metric strong {
  margin-top: 9px;
  font-size: 26px;
}

.metric small {
  margin-top: 8px;
}

.workbench-grid {
  gap: 12px;
  margin-bottom: 14px;
}

.workbench-card {
  min-height: 94px;
  padding: 14px;
  border-left: 4px solid #64748b;
}

.workbench-card strong {
  font-size: 24px;
}

.workbench-card.warn {
  border-color: #f59e0b;
  background: #fff;
}

.workbench-card.danger {
  border-color: var(--red);
  background: #fff;
}

.workbench-card.ok {
  border-color: var(--green);
  background: #fff;
}

.panel-head {
  min-height: 46px;
  padding: 11px 14px;
  background: #f8fafc;
}

.chart {
  height: 280px;
}

.toolbar {
  padding: 10px;
  margin-bottom: 10px;
}

.toolbar input,
.toolbar select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 34px;
  border-radius: 5px;
  background: #fff;
}

table {
  min-width: 920px;
}

th,
td {
  padding: 9px 11px;
  font-size: 13px;
}

th {
  color: #334155;
  background: #edf2f7;
  border-bottom-color: #cbd5e1;
}

tbody tr:nth-child(even) td {
  background: #fbfdff;
}

tbody tr:hover td {
  background: #eff6ff;
}

.tag {
  min-height: 22px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
  font-weight: 700;
}

.tag.danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.tag.warn {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fed7aa;
}

.tag.ok {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.mini-btn {
  min-height: 26px;
  border-radius: 4px;
  font-weight: 700;
}

.mini-btn.primary {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.mini-btn.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.business-settlement,
.service-card,
.polished-confirm,
.high-risk-box,
.modal-card {
  background: #fff;
}

.business-note,
#deviceScanResult .empty-panel,
.db-status {
  background: #f8fafc;
  border-radius: 5px;
}

.modal {
  background: rgba(15,23,42,.48);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.modal-card {
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(15,23,42,.24);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.modal-head {
  padding: 13px 16px;
  background: #f8fafc;
}

.form-grid {
  padding: 16px;
  gap: 12px;
}

.mobile-actions {
  border-radius: 10px;
}

@media (max-width: 980px) {
  .sidebar {
    background: #14233f;
    box-shadow: 0 6px 22px rgba(15,23,42,.14);
  }

  .brand {
    border-bottom: 0;
  }

  .nav-item {
    min-width: 92px;
    text-align: center;
  }

  .main {
    width: calc(100% - 24px);
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 22px;
  }

  .topbar {
    padding: 14px;
  }

  .mobile-actions {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15,23,42,.18);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobile-actions button {
    border-radius: 6px;
    background: #f1f5f9;
  }

  .mobile-actions button.active {
    background: var(--blue);
    box-shadow: none;
  }

  .feature-panel tr {
    border-radius: 6px;
    box-shadow: none;
    background: #fff;
  }
}

* { box-sizing: border-box; }
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(20,184,166,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,184,166,.035) 1px, transparent 1px),
    linear-gradient(135deg, #f9fafb 0%, #f0fdfa 46%, #f8fafc 100%);
  background-size: 36px 36px, 36px 36px, auto;
  overflow-x: hidden;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(20,184,166,.45) rgba(255,255,255,.38);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,.38);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(45,212,191,.85), rgba(20,184,166,.72));
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(20,184,166,.95), rgba(13,148,136,.9));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(20,184,166,.12) 22%, transparent 31% 48%, rgba(45,212,191,.10) 55%, transparent 66%),
    repeating-linear-gradient(125deg, rgba(255,255,255,.18) 0 1px, transparent 1px 18px);
  opacity: .62;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.7) 48%, transparent 100%);
  background-size: 140% 140%, 42px 42px;
  animation: glassWaveDrift 18s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  left: -12%;
  right: -12%;
  top: 92px;
  height: 260px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.46), transparent 58%),
    linear-gradient(100deg, transparent 8%, rgba(255,255,255,.28) 18%, rgba(20,184,166,.14) 36%, rgba(255,255,255,.18) 54%, transparent 78%);
  filter: blur(10px);
  transform: skewY(-5deg);
  opacity: .75;
  animation: glassRibbonFlow 16s ease-in-out infinite alternate;
}

button, input, select, textarea {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
input[type="checkbox"] {
  -webkit-appearance: auto;
  appearance: auto;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { transition: background .16s, border-color .16s, transform .08s, color .16s; }
button:active { transform: translateY(1px); }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 248px;
  height: 100vh;
  padding: 18px 14px;
  background: rgba(249, 250, 251, .72);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-right: 1px solid rgba(209, 213, 219, .55);
  border-bottom: 0;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transform: translateZ(0);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 4px 4px 14px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 12px 24px rgba(20,184,166,.28);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 12px; }

.nav {
  display: grid;
  align-items: start;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  width: 100%;
  padding: 0 2px 12px;
}
.nav-group {
  display: grid;
  gap: 6px;
}
.nav-group > span {
  padding: 0 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
}
.nav-item {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.nav-item:hover { color: var(--text); background: rgba(255,255,255,.75); }
.nav-item.active {
  color: #fff;
  background: #111827;
  box-shadow: 0 10px 22px rgba(17,24,39,.16);
}

.old-link {
  margin-top: 0;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid rgba(209, 213, 219, .8);
  border-radius: 999px;
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
  background: rgba(255,255,255,.66);
}
.old-link:hover { background: #fff; color: var(--text); }

.main {
  position: relative;
  z-index: 1;
  min-width: 0;
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0 28px;
  grid-column: 2;
}

.topbar {
  min-height: 118px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid rgba(209, 213, 219, .58);
  border-radius: 8px;
  background: rgba(255,255,255,.62);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.topbar::before,
.panel::before,
.metric::before,
.toolbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,.55), transparent 28%),
    linear-gradient(115deg, transparent 0 40%, rgba(20,184,166,.10) 48%, transparent 62%);
  opacity: .72;
  background-size: 180% 180%;
  animation: glassSheen 12s ease-in-out infinite;
}

.topbar > *,
.panel > *,
.metric > *,
.toolbar > * {
  position: relative;
  z-index: 1;
}

h1, h2, p { margin: 0; }
h1 { font-size: 44px; line-height: 1.08; letter-spacing: 0; }
h2 { font-size: 15px; letter-spacing: 0; }
.topbar p { margin-top: 10px; color: var(--muted); font-size: 17px; }

.top-actions, .toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-btn, .ghost-btn {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

.primary-btn { color: #fff; background: var(--blue); border-color: var(--blue); }
.primary-btn:hover { background: var(--blue-2); border-color: var(--blue-2); }
.ghost-btn { color: var(--text); background: #fff; border-color: var(--line-strong); }
.ghost-btn:hover { border-color: #b6c2d4; background: #f8fafc; }

.user-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  color: var(--muted);
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #f4d27b;
  background: #fff8e6;
  border-radius: 7px;
  color: #7a4b00;
}

.hidden { display: none !important; }
.view { display: none; }
.view.active { display: block; }
.view-enter {
  animation: viewSlideIn .28s ease both;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.workbench-card {
  min-height: 104px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  border: 1px solid rgba(209, 213, 219, .58);
  border-radius: 8px;
  background: rgba(255,255,255,.66);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.workbench-card span,
.workbench-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.workbench-card strong {
  display: block;
  margin: 8px 0 7px;
  font-size: 26px;
  line-height: 1;
}

.workbench-card.warn {
  border-color: rgba(245, 158, 11, .28);
  background: linear-gradient(135deg, rgba(255,247,237,.78), rgba(255,255,255,.64));
}

.workbench-card.danger {
  border-color: rgba(194, 65, 12, .25);
  background: linear-gradient(135deg, rgba(255,241,235,.82), rgba(255,255,255,.64));
}

.workbench-card.ok {
  border-color: rgba(20,184,166,.25);
  background: linear-gradient(135deg, rgba(240,253,250,.82), rgba(255,255,255,.64));
}

.metric {
  min-height: 118px;
  padding: 20px;
  background: rgba(255,255,255,.64);
  border: 1px solid rgba(209, 213, 219, .58);
  border-radius: 8px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.metric span { color: var(--muted); font-size: 13px; }
.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}
.metric small {
  display: block;
  margin-top: 11px;
  color: var(--muted);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(209, 213, 219, .58);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  position: relative;
  transform: translateZ(0);
}

.panel-head {
  min-height: 54px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.42);
}

.panel-head span { color: var(--muted); font-size: 13px; }
.muted-text { color: var(--muted); font-size: 13px; }
.panel-actions { display: inline-flex; align-items: center; gap: 10px; }
.compact { min-height: 32px; padding: 0 10px; font-size: 13px; }
.chart { height: 310px; }

.rank-list { padding: 8px 16px 14px; }
.rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 0; }
.rank-row span { color: var(--muted); }
.rank-row strong { color: var(--blue); }

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(209, 213, 219, .58);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.toolbar input, .toolbar select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 0 11px;
  color: var(--text);
  max-width: 100%;
}
.toolbar input { min-width: 280px; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(37,99,235,.12);
  border-color: #8eb3ff !important;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
  table-layout: auto;
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  background: #f8fafc;
}
tbody tr:hover td { background: #f9fbff; }

.tag {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #ccfbf1;
  color: var(--blue);
  border: 1px solid #99f6e4;
}
.tag.danger { background: #fff1eb; color: var(--red); border-color: #ffd7c2; }
.tag.warn { background: #fff7ed; color: var(--amber); border-color: #fed7aa; }
.tag.ok { background: #ecfdf3; color: var(--green); border-color: #bbf7d0; }
.tag.muted { background: #f3f4f6; color: var(--muted); border-color: #e5e7eb; }

.empty-panel { padding: 28px; }
.empty-panel p { margin-top: 8px; color: var(--muted); }
.action-row { display: inline-flex; gap: 6px; align-items: center; }
.mini-btn {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}
.mini-btn:hover { background: #f8fafc; }
.mini-btn.danger { color: var(--red); border-color: #fed7c3; background: #fffaf7; }
.mini-btn.primary { color: var(--blue-2); border-color: #99f6e4; background: #f0fdfa; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.audit-table td {
  vertical-align: top;
}

.audit-table strong {
  display: block;
  margin-bottom: 4px;
}

.row-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.feature-panel {
  min-height: 220px;
}

.business-tabs {
  align-items: stretch;
}

.business-tabs .primary-btn,
.business-tabs .ghost-btn {
  gap: 6px;
}

.compact-form {
  padding: 14px;
}

.business-settlement {
  background:
    linear-gradient(135deg, rgba(240,253,250,.78), rgba(255,255,255,.7) 44%, rgba(239,246,255,.78)),
    rgba(255,255,255,.66);
}

.business-note {
  margin: 0 14px 14px;
  padding: 11px 12px;
  border: 1px dashed rgba(20,184,166,.32);
  border-radius: 7px;
  background: rgba(255,255,255,.56);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

#deviceScanResult .empty-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.72);
}

.loading-panel {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.loading-panel strong {
  color: var(--text);
  font-size: 16px;
}

.loader-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(20,184,166,.18);
  border-top-color: var(--blue);
  animation: spinLoader .8s linear infinite;
}

.inline-loading {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.db-config-panel {
  padding: 22px;
}

.db-config-form {
  align-items: end;
}

.db-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
}

.db-status.ok {
  border-color: rgba(34,197,94,.35);
  background: rgba(240,253,244,.86);
  color: #15803d;
}

.db-status.error {
  border-color: rgba(239,68,68,.35);
  background: rgba(254,242,242,.9);
  color: #b91c1c;
}

.is-busy {
  opacity: .72;
  cursor: wait !important;
}

.polished-confirm {
  padding: 18px;
  border: 1px solid rgba(254,215,170,.9);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7ed, #fff);
}

.polished-confirm strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 17px;
}

.polished-confirm p {
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.65;
}

.polished-confirm span {
  color: var(--muted);
  font-size: 13px;
}

.high-risk-box {
  border-color: rgba(239,68,68,.28);
  background: linear-gradient(135deg, rgba(254,242,242,.96), rgba(255,255,255,.96));
}

.high-risk-box strong {
  color: #b91c1c;
}

.vue-modal-card {
  border: 1px solid rgba(217, 226, 239, .96);
}

.vue-confirm-modal {
  z-index: 1200;
}

.vue-modal-body {
  display: contents;
}

.vue-modal-card .confirm-box {
  position: relative;
}

.vue-modal-card .confirm-box::before {
  content: "!";
  position: absolute;
  right: 16px;
  top: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(224, 120, 0, .12);
  color: #b45309;
  font-weight: 900;
}

.vue-modal-card .high-risk-box::before {
  background: rgba(239, 68, 68, .12);
  color: #b91c1c;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 4px;
}

.service-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.service-card {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240,253,250,.92), rgba(255,255,255,.96));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.service-card strong,
.mini-panel h3 {
  display: block;
  margin: 0 0 6px;
  color: var(--text);
}

.service-card span {
  color: var(--muted);
  font-size: 13px;
}

.service-card:hover {
  border-color: #99f6e4;
  box-shadow: 0 12px 32px rgba(20,184,166,.12);
}

.mini-panel {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.workorder-actions {
  flex-wrap: wrap;
  max-width: 320px;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}
.list-panel { margin-top: 14px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15,23,42,.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .18s ease;
}
.modal.show {
  opacity: 1;
}
.modal-card {
  width: min(780px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15,23,42,.34);
  background:
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(240,253,250,.92)),
    #fff;
  border: 1px solid rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transform: translateY(18px) scale(.98);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.modal.show .modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

@keyframes glassWaveDrift {
  0% { transform: translate3d(-1.5%, -1%, 0) scale(1); background-position: 0% 0%, 0 0; }
  50% { transform: translate3d(1%, .8%, 0) scale(1.015); background-position: 55% 35%, 18px 12px; }
  100% { transform: translate3d(2%, -1.2%, 0) scale(1.02); background-position: 100% 70%, 36px 24px; }
}

@keyframes glassRibbonFlow {
  0% { transform: translateX(-3%) skewY(-5deg); opacity: .55; }
  50% { transform: translateX(2%) skewY(-4deg); opacity: .82; }
  100% { transform: translateX(5%) skewY(-6deg); opacity: .68; }
}

@keyframes glassSheen {
  0% { background-position: 0% 0%; opacity: .46; }
  50% { background-position: 88% 45%; opacity: .78; }
  100% { background-position: 0% 100%; opacity: .52; }
}

@keyframes viewSlideIn {
  0% { opacity: 0; transform: translateX(14px); }
  100% { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .topbar::before,
  .panel::before,
  .metric::before,
  .toolbar::before {
    animation: none;
  }
}
.modal-head {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: #f8fafc; }
.form-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 11px;
  color: var(--text);
  background: #fff;
  max-width: 100%;
}
.form-grid textarea { min-height: 82px; padding-top: 9px; resize: vertical; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}
.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 30;
}
.toast {
  min-width: 220px;
  padding: 11px 13px;
  border-radius: 7px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
}
.toast.error { background: var(--red); }
.toast.ok { background: var(--green); }
.danger-btn {
  background: var(--red);
  border-color: var(--red);
}
.danger-btn:hover {
  background: #9a3412;
  border-color: #9a3412;
}
.confirm-box {
  padding: 18px;
  color: var(--text);
}
.confirm-box p {
  font-size: 15px;
  margin-bottom: 8px;
}
.confirm-box span {
  color: var(--muted);
  font-size: 13px;
}
.pager {
  padding: 12px 14px;
  background: #fff;
}
.pager-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.page-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.page-dot {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.72);
  cursor: pointer;
}
.page-dot.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(20,184,166,.22);
}
.page-gap {
  color: var(--faint);
  padding: 0 2px;
}
.mini-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.empty-row td {
  padding: 0;
}
.empty-state {
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
}
.empty-state strong {
  color: var(--text);
  font-size: 15px;
}
.mobile-actions {
  display: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar,
  .topbar,
  .panel,
  .metric,
  .toolbar,
  .modal-card {
    background: rgba(255,255,255,.94);
  }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  padding: 18px;
}
.detail-grid div {
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.detail-grid strong { color: var(--text); margin-right: 8px; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 15%, rgba(37,99,235,.16), transparent 30rem),
    radial-gradient(circle at 85% 80%, rgba(8,145,178,.14), transparent 28rem),
    #f4f7fb;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--text);
  border-bottom-color: var(--line);
  padding-left: 0;
  margin-bottom: 22px;
}
.login-brand small { color: var(--muted); }
.login-card h1 { font-size: 24px; }
.login-card p {
  margin-top: 8px;
  margin-bottom: 20px;
  color: var(--muted);
}
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 7px; color: var(--muted); }
.login-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--text);
}
.login-submit { justify-content: center; margin-top: 4px; }
.login-error, .login-message {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-radius: 7px;
}
.login-error { color: var(--red); background: #fff1eb; }
.login-message { color: var(--blue); background: #eef4ff; }
.login-alt {
  display: inline-block;
  margin-top: 16px;
  color: var(--blue);
  text-decoration: none;
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 12px;
    gap: 12px;
    flex-wrap: wrap;
    overflow: hidden;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(209, 213, 219, .55);
  }
  .brand { padding-bottom: 12px; }
  .nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }
  .nav-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .nav-group > span {
    display: none;
  }
  .nav-item {
    width: auto;
    min-width: 78px;
    text-align: center;
  }
  .old-link { display: none; }
  .main { grid-column: 1; width: calc(100% - 28px); padding: 18px 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid, .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions { justify-content: space-between; flex-wrap: wrap; }
  .metrics { grid-template-columns: 1fr; }
  .workbench-grid { grid-template-columns: 1fr; }
  .workbench-card {
    min-height: 92px;
  }
  .toolbar input, .toolbar select, .toolbar .primary-btn, .toolbar .ghost-btn { width: 100%; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .business-tabs {
    position: sticky;
    top: 8px;
    z-index: 8;
  }
  .business-tabs .primary-btn,
  .business-tabs .ghost-btn {
    flex: 1 1 140px;
  }
  .compact-form {
    padding: 12px;
  }
  .main { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .mobile-actions {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 18;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 18px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 18px 46px rgba(15,23,42,.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .mobile-actions button {
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    color: var(--text);
    background: rgba(243,245,248,.86);
    font-size: 12px;
    font-weight: 700;
  }
  .mobile-actions button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), #0f766e);
    box-shadow: 0 10px 22px rgba(31,111,235,.24);
  }
  .pager-inner {
    justify-content: center;
    flex-wrap: wrap;
  }
  .modal {
    place-items: end center;
    padding: 0;
  }
  .modal-card {
    width: 100%;
    max-height: 88vh;
    border-radius: 8px 8px 0 0;
    transform: translateY(100%);
  }
  .modal.show .modal-card {
    transform: translateY(0);
  }
  .feature-panel .table-wrap {
    overflow: visible;
  }
  .feature-panel table,
  .feature-panel tbody,
  .feature-panel tr,
  .feature-panel td {
    display: block;
    width: 100%;
  }
  .feature-panel tr:first-child {
    display: none;
  }
  .feature-panel tr {
    margin: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 10px 28px rgba(15,23,42,.06);
  }
  .feature-panel td {
    padding: 8px 4px;
    border-bottom: 0;
    white-space: normal;
    word-break: break-word;
  }
  .feature-panel .action-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .feature-panel .mini-btn {
    width: 100%;
  }
  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 12px 8px;
  }
  .service-menu {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .mini-panel {
    margin: 0 12px 12px;
  }
  h1 { font-size: 22px; }
  .topbar {
    min-height: auto;
    padding: 18px;
  }
  .topbar p {
    font-size: 14px;
  }
  .brand {
    min-width: 0;
  }
  .brand small {
    display: none;
  }
  .nav {
    width: 100%;
    order: 2;
  }
  .sidebar {
    height: auto;
  }
}

/* Final broadband operator console skin. Keep this at the end so it wins. */
:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --text: #172033;
  --muted: #5d6678;
  --faint: #8a94a6;
  --line: #dde3ee;
  --line-strong: #c6cfdd;
  --blue: #1d4ed8;
  --blue-2: #1e40af;
  --green: #15803d;
  --red: #dc2626;
  --amber: #d97706;
  --cyan: #0ea5e9;
  --shadow: 0 8px 22px rgba(20, 31, 54, .08);
}

html,
body {
  background: var(--bg);
}

body {
  color: var(--text);
  background: linear-gradient(180deg, #f5f7fb 0%, #eef2f7 280px, #eef2f7 100%);
}

body::before,
body::after,
.topbar::before,
.panel::before,
.metric::before,
.toolbar::before {
  content: none !important;
  animation: none !important;
}

::-webkit-scrollbar-track { background: #e8edf5; }
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover {
  background: #aeb8c8;
  border-color: #e8edf5;
}

.sidebar {
  background: #14233f;
  color: #dbeafe;
  border-right: 1px solid #0f1a30;
  box-shadow: 8px 0 28px rgba(15, 23, 42, .16);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.brand { border-bottom-color: rgba(219,234,254,.14); }
.brand-mark {
  background: #2563eb;
  color: #fff;
  box-shadow: none;
}
.brand strong { color: #fff; }
.brand small,
.nav-group > span { color: #8fa6ca; }

.nav-item {
  color: #c9d7f0;
  border-radius: 6px;
  font-weight: 600;
}
.nav-item:hover {
  color: #fff;
  background: rgba(37, 99, 235, .18);
}
.nav-item.active {
  color: #fff;
  background: #2563eb;
  box-shadow: inset 3px 0 0 #93c5fd;
}

.main {
  width: min(1240px, calc(100% - 40px));
  padding-top: 24px;
}

.topbar,
.panel,
.metric,
.toolbar,
.workbench-card,
.loading-panel,
.mini-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.topbar {
  min-height: 92px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-top: 4px solid var(--blue);
}

h1 {
  font-size: 30px;
  line-height: 1.18;
}
h2 {
  font-size: 14px;
  font-weight: 800;
}
.topbar p {
  margin-top: 6px;
  font-size: 14px;
}

.user-pill {
  min-height: 34px;
  border-radius: 6px;
  background: #f8fafc;
}

.primary-btn,
.ghost-btn {
  min-height: 34px;
  border-radius: 5px;
  padding: 0 12px;
  font-size: 13px;
}
.primary-btn {
  background: var(--blue);
  border-color: var(--blue);
}
.primary-btn:hover {
  background: var(--blue-2);
  border-color: var(--blue-2);
}
.ghost-btn {
  background: #f8fafc;
  border-color: var(--line-strong);
}

.metrics {
  gap: 12px;
  margin-bottom: 12px;
}
.metric {
  min-height: 98px;
  padding: 16px;
  border-left: 4px solid var(--blue);
}
.metric strong {
  margin-top: 9px;
  font-size: 26px;
}
.metric small { margin-top: 8px; }

.workbench-grid {
  gap: 12px;
  margin-bottom: 14px;
}
.workbench-card {
  min-height: 94px;
  padding: 14px;
  border-left: 4px solid #64748b;
}
.workbench-card strong { font-size: 24px; }
.workbench-card.warn,
.workbench-card.danger,
.workbench-card.ok { background: #fff; }
.workbench-card.warn { border-color: #f59e0b; }
.workbench-card.danger { border-color: var(--red); }
.workbench-card.ok { border-color: var(--green); }

.panel-head {
  min-height: 46px;
  padding: 11px 14px;
  background: #f8fafc;
}
.chart { height: 280px; }
.toolbar {
  padding: 10px;
  margin-bottom: 10px;
}
.toolbar input,
.toolbar select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 34px;
  border-radius: 5px;
  background: #fff;
}

table { min-width: 920px; }
th,
td {
  padding: 9px 11px;
  font-size: 13px;
}
th {
  color: #334155;
  background: #edf2f7;
  border-bottom-color: #cbd5e1;
}
tbody tr:nth-child(even) td { background: #fbfdff; }
tbody tr:hover td { background: #eff6ff; }

.tag {
  min-height: 22px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
  font-weight: 700;
}
.tag.danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}
.tag.warn {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fed7aa;
}
.tag.ok {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.mini-btn {
  min-height: 26px;
  border-radius: 4px;
  font-weight: 700;
}
.mini-btn.primary {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}
.mini-btn.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.business-settlement,
.service-card,
.polished-confirm,
.high-risk-box,
.modal-card { background: #fff; }

.business-note,
#deviceScanResult .empty-panel,
.db-status {
  background: #f8fafc;
  border-radius: 5px;
}

.modal {
  background: rgba(15,23,42,.48);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.modal-card {
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(15,23,42,.24);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.modal-head {
  padding: 13px 16px;
  background: #f8fafc;
}
.form-grid {
  padding: 16px;
  gap: 12px;
}

@media (max-width: 980px) {
  .sidebar {
    background: #14233f;
    box-shadow: 0 6px 22px rgba(15,23,42,.14);
  }
  .brand { border-bottom: 0; }
  .nav-item {
    min-width: 92px;
    text-align: center;
  }
  .main { width: calc(100% - 24px); }
}

@media (max-width: 620px) {
  h1 { font-size: 22px; }
  .topbar { padding: 14px; }
  .mobile-actions {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15,23,42,.18);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .mobile-actions button {
    border-radius: 6px;
    background: #f1f5f9;
  }
  .mobile-actions button.active {
    background: var(--blue);
    box-shadow: none;
  }
  .feature-panel tr {
    border-radius: 6px;
    box-shadow: none;
    background: #fff;
  }
}

/* No horizontal record scrolling: all tables fit the page and wrap content. */
.table-wrap {
  width: 100%;
  overflow-x: hidden !important;
  overflow-y: visible;
}

table,
.feature-panel table,
.audit-table table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  table-layout: fixed;
}

th,
td {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

th {
  position: static;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.mini-btn,
.primary-btn,
.ghost-btn {
  white-space: normal;
}

td .row-note,
td small {
  white-space: normal;
}

@media (max-width: 980px) {
  table {
    font-size: 12px;
  }

  th,
  td {
    padding: 8px 7px;
  }
}

@media (max-width: 620px) {
  .table-wrap {
    overflow: visible !important;
  }

  .panel:not(.feature-panel) table,
  .panel:not(.feature-panel) tbody,
  .panel:not(.feature-panel) tr,
  .panel:not(.feature-panel) td {
    display: block;
    width: 100% !important;
  }

  .panel:not(.feature-panel) thead,
  .panel:not(.feature-panel) th {
    display: none;
  }

  .panel:not(.feature-panel) tr {
    margin: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
  }

  .panel:not(.feature-panel) td {
    padding: 7px 4px;
    border-bottom: 0;
  }
}

/* Vue-designed broadband OSS/BSS console layer. */
:root {
  --oss-bg: #f3f6fb;
  --oss-sidebar: #0b1f3a;
  --oss-sidebar-2: #102d55;
  --oss-blue: #1769e0;
  --oss-blue-dark: #0f4fb3;
  --oss-cyan: #0891b2;
  --oss-card: #ffffff;
  --oss-line: #d9e2ef;
  --oss-soft: #f7f9fc;
}

body {
  background:
    linear-gradient(180deg, #f7faff 0, var(--oss-bg) 320px),
    var(--oss-bg);
}

.shell {
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  width: 264px;
  padding: 16px 12px;
  background:
    linear-gradient(180deg, var(--oss-sidebar) 0%, var(--oss-sidebar-2) 100%);
}

.brand {
  gap: 10px;
  padding: 8px 8px 16px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: 0 12px 26px rgba(37,99,235,.24);
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0;
}

.brand small {
  color: #9db4d4;
}

.nav {
  gap: 16px;
  padding: 2px 2px 14px;
}

.nav-group {
  gap: 5px;
}

.nav-group > span {
  padding: 0 10px 3px;
  color: #83a0c5;
  font-size: 11px;
}

.nav-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: #c9d7ec;
  border-radius: 8px;
}

.nav-item b {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  color: #dbeafe;
  font-size: 12px;
  font-style: normal;
}

.nav-item em {
  font-style: normal;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
}

.nav-item.active {
  background: #fff;
  color: #0f2748;
  box-shadow: 0 12px 26px rgba(0,0,0,.18);
}

.nav-item.active b {
  background: var(--oss-blue);
  color: #fff;
}

.main {
  width: min(1280px, calc(100% - 36px));
  padding-top: 22px;
}

.shell,
.sidebar,
.main {
  transition: grid-template-columns .2s ease, width .2s ease, padding .2s ease, background .2s ease;
}

body.sidebar-collapsed .shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

body.sidebar-collapsed .brand span:last-child,
body.sidebar-collapsed .nav-group > span,
body.sidebar-collapsed .nav-item em {
  display: none;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

.topbar {
  border: 1px solid var(--oss-line);
  border-left: 5px solid var(--oss-blue);
  border-top: 1px solid var(--oss-line);
  background:
    linear-gradient(90deg, rgba(23,105,224,.08), transparent 42%),
    #fff;
}

.topbar h1 {
  color: #10213d;
}

.primary-btn {
  background: var(--oss-blue);
  border-color: var(--oss-blue);
}

.primary-btn:hover {
  background: var(--oss-blue-dark);
  border-color: var(--oss-blue-dark);
}

.metric,
.workbench-card,
.panel,
.toolbar {
  border-color: var(--oss-line);
}

.metric {
  border-left-color: var(--oss-blue);
  background:
    linear-gradient(180deg, #fff, #fbfdff);
}

.metric span,
.workbench-card span {
  color: #64748b;
  font-weight: 700;
}

.metric strong,
.workbench-card strong {
  color: #0f172a;
}

.workbench-card {
  border-left-color: #94a3b8;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
}

.workbench-card.warn { border-left-color: #f59e0b; }
.workbench-card.danger { border-left-color: #ef4444; }
.workbench-card.ok { border-left-color: #16a34a; }

.panel-head {
  background: #f8fafd;
}

.panel-head h2 {
  color: #10213d;
}

.toolbar {
  background: #fff;
}

th {
  background: #edf3fb;
}

.tag {
  border-radius: 5px;
}

.mobile-actions button b {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

.mobile-actions button span {
  display: block;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: auto;
    background: var(--oss-sidebar);
  }

  .nav-item {
    display: inline-grid;
    grid-template-columns: 22px auto;
    min-width: 112px;
  }
}

@media (max-width: 620px) {
  .mobile-actions {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .mobile-actions button {
    min-height: 46px;
  }
}

/* Vue login page redesign. */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(23,105,224,.10), transparent 38%),
    linear-gradient(180deg, #f7faff 0%, #edf3fb 100%);
}

.login-shell-vue {
  width: min(1080px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) 420px;
  border: 1px solid var(--oss-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 35, 75, .16);
  overflow: hidden;
}

.login-visual {
  padding: 42px;
  display: grid;
  align-content: space-between;
  gap: 28px;
  color: #dbeafe;
  background:
    linear-gradient(135deg, rgba(56,189,248,.14), transparent 42%),
    linear-gradient(180deg, #0b1f3a 0%, #102d55 100%);
}

.login-brandline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brandline .brand-mark {
  flex: 0 0 auto;
}

.login-brandline strong,
.login-brandline small {
  display: block;
}

.login-brandline strong {
  color: #fff;
  font-size: 18px;
}

.login-brandline small {
  margin-top: 4px;
  color: #9db4d4;
}

.login-copy span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(147,197,253,.34);
  border-radius: 999px;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
}

.login-copy h1 {
  max-width: 580px;
  margin: 18px 0 14px;
  color: #fff;
  font-size: 38px;
  line-height: 1.18;
}

.login-copy p {
  max-width: 560px;
  color: #b8c9e6;
  line-height: 1.8;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.login-stats div {
  min-height: 84px;
  padding: 14px;
  border: 1px solid rgba(219,234,254,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
}

.login-stats strong,
.login-stats small {
  display: block;
}

.login-stats strong {
  color: #fff;
  font-size: 16px;
}

.login-stats small {
  margin-top: 8px;
  color: #b8c9e6;
  line-height: 1.5;
}

.login-card-vue {
  width: 100%;
  padding: 42px 34px;
  align-self: stretch;
  display: grid;
  align-content: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-card-head {
  margin-bottom: 24px;
}

.login-card-head span {
  color: var(--oss-blue);
  font-size: 13px;
  font-weight: 800;
}

.login-card-head strong,
.login-card-head small {
  display: block;
}

.login-card-head strong {
  margin-top: 8px;
  color: #0f172a;
  font-size: 28px;
}

.login-card-head small {
  margin-top: 7px;
  color: var(--muted);
}

.login-card-vue form {
  display: grid;
  gap: 15px;
}

.login-card-vue label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-card-vue input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
}

.login-card-vue input:focus {
  outline: 3px solid rgba(23,105,224,.12);
  border-color: var(--oss-blue);
}

.login-card-vue .login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  justify-content: center;
  font-size: 15px;
}

.login-card-vue .login-submit:disabled {
  opacity: .72;
  cursor: wait;
}

@media (max-width: 860px) {
  .login-shell-vue {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-visual {
    padding: 28px;
  }

  .login-copy h1 {
    font-size: 28px;
  }

  .login-card-vue {
    padding: 28px;
  }
}

@media (max-width: 560px) {
  .login-page {
    padding: 12px;
  }

  .login-visual {
    display: none;
  }

  .login-shell-vue {
    border-radius: 8px;
  }
}

/* Vue page runtime shell for every business module. */
.legacy-dynamic {
  display: none !important;
}

.vue-page-shell {
  display: grid;
  gap: 14px;
}

.vue-page-head {
  min-height: 78px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--oss-line);
  border-left: 5px solid var(--oss-blue);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23,105,224,.08), transparent 46%),
    #fff;
  box-shadow: var(--shadow);
}

.vue-page-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--oss-blue);
  color: #fff;
  font-weight: 900;
}

.vue-page-head h2 {
  margin: 0;
  color: #10213d;
  font-size: 22px;
}

.vue-page-head p {
  margin-top: 4px;
  color: var(--muted);
}

.vue-page-body {
  display: grid;
  gap: 12px;
}

.vue-page-body > .toolbar:first-child {
  margin-bottom: 0;
}

.vue-loading {
  min-height: 260px;
}

/* Vue componentized OSS/BSS page primitives. */
.vue-component-body {
  container-type: inline-size;
}

.oss-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 0;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.oss-toolbar input,
.oss-toolbar select {
  min-width: 180px;
}

.oss-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.oss-metric-card {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  border-left: 4px solid var(--oss-blue);
}

.oss-metric-card::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(23, 105, 224, .16), rgba(8, 145, 178, .1));
}

.oss-grid {
  gap: 14px;
}

.oss-panel {
  overflow: hidden;
}

.oss-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid #e5edf7;
}

.oss-panel-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.oss-panel-title h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oss-panel-body {
  padding: 14px;
}

.oss-table-shell {
  border: 0;
  border-radius: 0;
  background: #fff;
}

.oss-data-table th {
  height: 42px;
  color: #53627a;
  background: #f4f7fb;
  border-bottom: 1px solid #e5edf7;
}

.oss-data-table td {
  height: 46px;
}

.oss-data-table td:first-child,
.oss-data-table th:first-child {
  padding-left: 16px;
}

.oss-data-table td:last-child,
.oss-data-table th:last-child {
  padding-right: 16px;
}

.oss-panel-footer {
  border-top: 1px solid #edf2f8;
  background: #fbfdff;
}

.oss-panel-footer .pager {
  margin: 0;
  padding: 10px 14px;
}

.oss-html-section > .empty-panel,
.vue-component-body .empty-panel {
  border: 1px dashed #c8d5e6;
  border-radius: 12px;
  background: #f8fbff;
}

@container (max-width: 860px) {
  .oss-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 560px) {
  .oss-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .oss-toolbar input,
  .oss-toolbar select,
  .oss-toolbar button,
  .oss-toolbar a {
    width: 100%;
  }

  .oss-metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .vue-page-head {
    min-height: auto;
    padding: 13px;
  }

  .vue-page-icon {
    width: 36px;
    height: 36px;
  }

  .vue-page-head h2 {
    font-size: 18px;
  }
}

/* Designer refresh: broadband service desk UI. */
:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f7f9fd;
  --text: #182235;
  --muted: #627086;
  --faint: #98a3b5;
  --line: #dfe6f1;
  --line-strong: #bfcbda;
  --blue: #1769e0;
  --blue-2: #0f55bd;
  --green: #159947;
  --red: #d92d20;
  --amber: #e07800;
  --cyan: #0ea5e9;
  --shadow: 0 8px 24px rgba(31, 45, 70, .07);
}

body {
  background:
    linear-gradient(180deg, #edf4ff 0, #f3f6fb 210px),
    #f3f6fb;
}

.shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  width: 236px;
  padding: 16px 12px;
  background: #ffffff;
  color: var(--text);
  border-right: 1px solid #dce5f2;
  box-shadow: 8px 0 26px rgba(31, 45, 70, .06);
}

.brand {
  padding: 6px 8px 16px;
  border-bottom: 1px solid #e5ecf6;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1769e0;
  color: #fff;
}

.brand strong {
  color: var(--text);
  font-size: 16px;
}

.brand small {
  color: var(--muted);
}

.nav {
  gap: 16px;
}

.nav-group {
  gap: 5px;
}

.nav-group > span {
  padding: 0 10px;
  color: #8390a5;
  font-size: 12px;
}

.nav-item {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  color: #38465c;
  background: transparent;
  font-weight: 700;
}

.nav-item:hover {
  color: #0f55bd;
  background: #eef5ff;
}

.nav-item.active {
  color: #fff;
  background: #1769e0;
  box-shadow: 0 8px 18px rgba(23,105,224,.22);
}

.main {
  width: min(1280px, calc(100% - 36px));
  padding-top: 22px;
}

.topbar {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 20px 22px;
  border: 1px solid #dbe6f5;
  border-radius: 14px;
  border-top: 0;
  background:
    linear-gradient(90deg, rgba(23,105,224,.08), transparent 42%),
    #fff;
  box-shadow: var(--shadow);
}

h1 {
  font-size: 32px;
  font-weight: 850;
}

.topbar p {
  color: #64748b;
}

.top-loading-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1769e0;
  font-size: 12px;
  font-weight: 800;
}

.top-loading-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #1769e0;
  animation: pulseDot 1s ease-in-out infinite;
}

.top-loading-line {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 38%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1769e0, #0ea5e9, #22c55e);
  animation: topLoadingSlide 1.05s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: .45; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes topLoadingSlide {
  0% { transform: translateX(-120%); }
  55% { transform: translateX(120%); }
  100% { transform: translateX(285%); }
}

.top-actions {
  gap: 8px;
}

.icon-tool-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #cfd9e8;
  border-radius: 9px;
  background: #fff;
  color: #31425c;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.icon-tool-btn:hover {
  color: #1769e0;
  background: #eef5ff;
  border-color: #bfdbfe;
}

.tabs-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: -4px 0 14px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid #dbe6f5;
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 6px 18px rgba(31, 45, 70, .05);
}

.workspace-tabs-list {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.workspace-tab-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid #dbe6f5;
}

.workspace-tab-tools button {
  height: 28px;
  padding: 0 9px;
  border: 1px solid #cfd9e8;
  border-radius: 8px;
  background: #fff;
  color: #53627a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.workspace-tab-tools button:hover {
  color: #1769e0;
  background: #eef5ff;
}

.workspace-tab {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #53627a;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.workspace-tab:hover {
  color: #1769e0;
  background: #eef5ff;
}

.workspace-tab.active {
  color: #fff;
  background: #1769e0;
  border-color: #1769e0;
  box-shadow: 0 6px 14px rgba(23, 105, 224, .18);
}

.workspace-tab b {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
}

.workspace-tab b:hover {
  background: rgba(255, 255, 255, .22);
}

[data-theme="dark"] body {
  background:
    linear-gradient(180deg, #101827 0, #111827 260px),
    #111827;
  color: #e5e7eb;
}

[data-theme="dark"] .topbar,
[data-theme="dark"] .panel,
[data-theme="dark"] .metric,
[data-theme="dark"] .toolbar,
[data-theme="dark"] .tabs-bar,
[data-theme="dark"] .workbench-card,
[data-theme="dark"] .modal-card {
  background: #172033;
  border-color: #26364f;
  color: #e5e7eb;
}

[data-theme="dark"] .panel-head,
[data-theme="dark"] th,
[data-theme="dark"] .workspace-tab-tools button,
[data-theme="dark"] .icon-tool-btn,
[data-theme="dark"] .ghost-btn,
[data-theme="dark"] .user-pill {
  background: #111827;
  border-color: #2d3d57;
  color: #dbe4f0;
}

[data-theme="dark"] .topbar p,
[data-theme="dark"] .metric span,
[data-theme="dark"] .metric small,
[data-theme="dark"] td,
[data-theme="dark"] .workspace-tab {
  color: #aebbd0;
}

[data-theme="dark"] tbody tr:nth-child(even) td,
[data-theme="dark"] tbody tr:hover td {
  background: #1d2940;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0f172a;
  border-color: #2d3d57;
  color: #e5e7eb;
}

.user-pill {
  border-radius: 999px;
  background: #f3f7fd;
  border-color: #dbe6f5;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-pill strong {
  font-size: 13px;
  font-weight: 850;
}

.user-pill small {
  color: #64748b;
  font-size: 12px;
}

.primary-btn,
.ghost-btn {
  min-height: 36px;
  border-radius: 8px;
  font-weight: 750;
}

.primary-btn {
  background: #1769e0;
  border-color: #1769e0;
}

.ghost-btn {
  background: #fff;
  border-color: #cfd9e8;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid #dbe6f5;
  border-radius: 14px;
  border-left: 0;
  background: #fff;
}

.metric span {
  color: #64748b;
  font-weight: 700;
}

.metric strong {
  margin-top: 12px;
  color: #0f172a;
  font-size: 30px;
  font-weight: 850;
}

.metric small {
  color: #718096;
}

.workbench-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.workbench-card {
  min-height: 108px;
  padding: 16px;
  border: 1px solid #dbe6f5;
  border-radius: 14px;
  border-left: 0;
  background: #fff;
}

.workbench-card strong {
  font-size: 26px;
  font-weight: 850;
}

.workbench-card.warn {
  border-top: 4px solid #f59e0b;
}

.workbench-card.danger {
  border-top: 4px solid #ef4444;
}

.workbench-card.ok {
  border-top: 4px solid #22c55e;
}

.panel {
  border: 1px solid #dbe6f5;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.panel-head {
  min-height: 50px;
  padding: 13px 16px;
  background: #fbfcff;
}

.panel-head h2 {
  font-size: 15px;
  font-weight: 850;
}

.toolbar {
  padding: 12px;
  border: 1px solid #dbe6f5;
  border-radius: 14px;
  background: #fff;
}

.toolbar input,
.toolbar select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 38px;
  border-radius: 8px;
  border-color: #cfd9e8;
}

table {
  table-layout: fixed;
}

th {
  padding: 10px 12px;
  color: #45556f;
  background: #f2f6fc;
  font-weight: 850;
}

td {
  padding: 11px 12px;
  color: #253044;
}

tbody tr:nth-child(even) td {
  background: #fcfdff;
}

tbody tr:hover td {
  background: #eef5ff;
}

.tag {
  border-radius: 999px;
  font-weight: 800;
}

.mini-btn {
  min-height: 28px;
  border-radius: 7px;
}

.mini-btn.primary {
  color: #1769e0;
  background: #eef5ff;
  border-color: #bfdbfe;
}

.business-settlement,
.service-card,
.mini-panel,
.db-status {
  border-radius: 14px;
}

.service-card {
  background: #fff;
  border-color: #dbe6f5;
}

.modal-card {
  border-radius: 14px;
}

.modal-head {
  border-radius: 14px 14px 0 0;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: auto;
    background: #fff;
  }

  .brand strong {
    color: var(--text);
  }

  .nav-item {
    color: #38465c;
  }

  .nav-item.active {
    color: #fff;
  }

  .metrics,
  .workbench-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar,
  .panel,
  .metric,
  .workbench-card,
  .toolbar {
    border-radius: 12px;
  }

  .metrics,
  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .mobile-actions {
    border-radius: 14px;
    background: #fff;
  }

  .mobile-actions button {
    border-radius: 10px;
  }

  .tabs-bar {
    grid-template-columns: 1fr;
  }

  .workspace-tab-tools {
    justify-content: flex-end;
    padding-left: 0;
    border-left: 0;
  }

  body.sidebar-collapsed .shell {
    grid-template-columns: 1fr;
  }
}

/* ===== 移动端 UX 优化 ===== */
@media (max-width: 768px) {
  /* 表格横向滚动优化 */
  .table-wrap {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    margin: 0 -12px;
    padding: 0 12px;
  }

  .table-wrap table {
    min-width: 640px;
    font-size: 13px;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  /* 按钮加大，方便点击 */
  .mini-btn {
    padding: 6px 10px;
    font-size: 13px;
    min-height: 32px;
  }

  .primary-btn,
  .ghost-btn,
  .danger-btn {
    min-height: 40px;
    padding: 0 16px;
    font-size: 14px;
  }

  /* 弹窗优化 */
  .modal-content {
    margin: 5vh auto;
    max-width: calc(100% - 24px);
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-body {
    padding: 16px;
  }

  /* 表单优化 */
  .form-grid label {
    min-height: 44px;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    min-height: 40px;
    font-size: 14px;
  }

  /* 工具栏换行 */
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar button {
    flex: 1;
    min-width: auto;
  }

  /* 搜索框 */
  .toolbar input[type="search"],
  .toolbar input[type="text"] {
    flex: 2;
    min-width: 120px;
    min-height: 40px;
  }

  /* 指标卡片 */
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .metric {
    padding: 12px;
  }

  .metric strong {
    font-size: 20px;
  }

  /* 面板头部 */
  .panel-head {
    padding: 12px 16px;
  }

  .panel-head h2 {
    font-size: 16px;
  }

  /* 操作按钮列：横向滚动 */
  .action-row {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
  }
}

@media (max-width: 480px) {
  /* 小屏进一步优化 */
  .metrics {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 0;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .toolbar button {
    font-size: 12px;
    padding: 0 8px;
  }

  .table-wrap table {
    font-size: 12px;
    min-width: 560px;
  }
}

/* ===== 风险级别标签 ===== */
.risk-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  vertical-align: middle;
}
.risk-tag.high {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.risk-tag.medium {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}
.risk-tag.normal {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
tr.log-row-high {
  background: #fef2f2 !important;
}
tr.log-row-high:hover {
  background: #fee2e2 !important;
}
tr.log-row-medium {
  background: #fff7ed !important;
}
tr.log-row-medium:hover {
  background: #ffedd5 !important;
}

/* Customer identity and actions share one scan-friendly column. */
.oss-data-table .user-info-cell,
#userRows .user-info-cell {
  min-width: 390px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.user-info-cell > strong,
.user-info-cell > small {
  display: block;
}

.user-info-cell > small {
  margin-top: 2px;
  color: #64748b;
}

.user-info-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  width: max-content;
  margin-top: 8px;
  padding-bottom: 2px;
}

.user-info-actions .mini-btn {
  flex: 0 0 auto;
  white-space: nowrap !important;
}

/* Final desktop theme and collapsed-sidebar contrast fixes. */
@media (min-width: 981px) {
  body.sidebar-collapsed .sidebar {
    width: 76px;
  }

  body.sidebar-collapsed .nav-item {
    grid-template-columns: 25px;
    justify-content: center;
    justify-items: center;
  }
}

html:not([data-theme="dark"]) .nav-item b {
  background: #eef5ff;
  color: #1769e0;
}

html:not([data-theme="dark"]) .nav-item:hover b {
  background: #dbeafe;
  color: #0f55bd;
}

html:not([data-theme="dark"]) .nav-item.active b {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

[data-theme="dark"] {
  --text: #e5e7eb;
  --muted: #aebbd0;
  --line: #2d3d57;
  --line-strong: #3b4d6a;
  --panel: #172033;
  --panel-soft: #1d2940;
}

[data-theme="dark"] body {
  background: linear-gradient(180deg, #101827 0, #111827 260px), #111827;
  color: #e5e7eb;
}

[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #0b1f3a 0%, #102d55 100%);
  color: #dbeafe;
  border-right-color: #26364f;
  box-shadow: 8px 0 26px rgba(0, 0, 0, .18);
}

[data-theme="dark"] .brand {
  border-bottom-color: rgba(219, 234, 254, .14);
}

[data-theme="dark"] .brand strong,
[data-theme="dark"] .brand small,
[data-theme="dark"] .nav-item,
[data-theme="dark"] .nav-item b {
  color: #dbeafe;
}

[data-theme="dark"] .brand small,
[data-theme="dark"] .nav-group > span {
  color: #8fa6ca;
}

[data-theme="dark"] .nav-item b {
  background: rgba(255, 255, 255, .08);
}

[data-theme="dark"] .nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, .10);
}

[data-theme="dark"] .nav-item.active {
  color: #fff;
  background: #2563eb;
}

[data-theme="dark"] .nav-item.active b {
  color: #fff;
  background: rgba(255, 255, 255, .20);
}

[data-theme="dark"] .topbar,
[data-theme="dark"] .panel,
[data-theme="dark"] .metric,
[data-theme="dark"] .toolbar,
[data-theme="dark"] .tabs-bar,
[data-theme="dark"] .workbench-card,
[data-theme="dark"] .service-card,
[data-theme="dark"] .modal-card {
  background: #172033;
  border-color: #2d3d57;
  color: #e5e7eb;
}

[data-theme="dark"] .panel-head,
[data-theme="dark"] th,
[data-theme="dark"] .workspace-tab-tools button,
[data-theme="dark"] .icon-tool-btn,
[data-theme="dark"] .ghost-btn,
[data-theme="dark"] .user-pill {
  background: #111827;
  border-color: #2d3d57;
  color: #dbe4f0;
}

[data-theme="dark"] .topbar h1,
[data-theme="dark"] .panel h2,
[data-theme="dark"] .panel h3,
[data-theme="dark"] .panel-head h2,
[data-theme="dark"] .user-info-cell > strong {
  color: #f1f5f9;
}

[data-theme="dark"] .topbar p,
[data-theme="dark"] .metric span,
[data-theme="dark"] .metric small,
[data-theme="dark"] .workspace-tab,
[data-theme="dark"] .user-info-cell > small {
  color: #aebbd0;
}

[data-theme="dark"] tbody td {
  color: #cbd5e1;
  background: #172033;
  border-color: #2d3d57;
}

[data-theme="dark"] tbody tr:nth-child(even) td,
[data-theme="dark"] tbody tr:hover td {
  color: #dbe4f0;
  background: #1d2940;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  color: #e5e7eb;
  background: #0f172a;
  border-color: #2d3d57;
}

/* Keep customer actions inside the mobile customer card. */
@media (max-width: 620px) {
  .panel:not(.feature-panel) td[data-label] {
    display: grid;
    grid-template-columns: minmax(76px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    white-space: normal !important;
  }

  .panel:not(.feature-panel) td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }

  #usersView .user-info-cell {
    display: grid !important;
    grid-template-columns: minmax(76px, 34%) minmax(0, 1fr);
    grid-auto-rows: auto;
    align-items: start;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    white-space: normal !important;
  }

  #usersView .user-info-cell > strong {
    grid-column: 2;
    grid-row: 1;
  }

  #usersView .user-info-cell > small {
    grid-column: 2;
    grid-row: 2;
  }

  #usersView .user-info-cell > .user-info-actions {
    position: static !important;
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    padding: 0;
  }

  #usersView .user-info-actions .mini-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 6px;
    white-space: nowrap !important;
  }
}
