:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #dadce0;
  --text: #202124;
  --muted: #5f6368;
  --accent: #1a73e8;
  --accent-hover: #1765cc;
  --accent-soft: #e8f0fe;
  --danger: #d93025;
  --danger-soft: #fce8e6;
  --success: #188038;
  --success-soft: #e6f4ea;
  --warning: #b06000;
  --warning-soft: #fef7e0;
  --hover-bg: #f1f3f4;
  --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.15);
  --shadow-md: 0 2px 6px rgba(60, 64, 67, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #202124;
    --surface: #292a2d;
    --border: #3c4043;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --accent: #8ab4f8;
    --accent-hover: #aecbfa;
    --accent-soft: #1f3350;
    --danger: #f28b82;
    --danger-soft: #3c1f1e;
    --success: #81c995;
    --success-soft: #1e3c26;
    --warning: #fdd663;
    --warning-soft: #3d2e00;
    --hover-bg: #3c4043;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #202124;
  --surface: #292a2d;
  --border: #3c4043;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #8ab4f8;
  --accent-hover: #aecbfa;
  --accent-soft: #1f3350;
  --danger: #f28b82;
  --danger-soft: #3c1f1e;
  --success: #81c995;
  --success-soft: #1e3c26;
  --warning: #fdd663;
  --warning-soft: #3d2e00;
  --hover-bg: #3c4043;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

input[type="text"],
input[type="password"] {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* --- Login page --- */

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 380px;
}

.card .brand-icon {
  display: block;
  text-align: center;
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.card h1 {
  margin: 0 0 1.5rem;
  font-size: 1.3rem;
  font-weight: 500;
  text-align: center;
  color: var(--text);
}

.card label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  margin-top: 1rem;
}

.card input[type="text"],
.card input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
}

.btn-primary {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--accent);
  color: white;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-sm);
}

.btn-full {
  width: 100%;
  margin-top: 1.6rem;
}

.error {
  font-size: 0.85rem;
}

.card .error {
  background: var(--danger-soft);
  border: 1px solid #f6aea9;
  color: var(--danger);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  margin-top: 1rem;
}

/* --- App shell --- */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
  padding: 0 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 200px;
  font-size: 1.15rem;
  font-weight: 500;
}

.topbar-brand .brand-icon {
  font-size: 1.4rem;
}

.topbar-search {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--hover-bg);
  border-radius: 24px;
  padding: 0.55rem 1rem;
}

.topbar-search-spacer {
  flex: 1;
}

.topbar-search:focus-within {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.topbar-search input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0;
}

.topbar-search input[type="text"]:focus {
  outline: none;
}

.search-icon {
  opacity: 0.6;
}

.search-clear {
  text-decoration: none;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
  border-radius: 50%;
}

.search-clear:hover {
  background: var(--border);
}

.topbar-user {
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--hover-bg);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar:hover {
  box-shadow: var(--shadow-sm);
}

.tabbar {
  display: flex;
  gap: 0.25rem;
  padding: 0 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab {
  display: inline-block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.main-full {
  padding-top: 1.5rem;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.btn-secondary {
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--hover-bg);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-row select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.group-header td {
  background: var(--hover-bg);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.group-count {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

/* --- Sidebar --- */

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.75rem;
  overflow-y: auto;
}

.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.btn-new:hover {
  box-shadow: var(--shadow-md);
}

.plus {
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 600;
}

.sidebar-tree {
  display: flex;
  flex-direction: column;
}

.tree-item {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 0 20px 20px 0;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-item:hover {
  background: var(--hover-bg);
}

.tree-item.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 500;
}

/* --- Dropdown menus --- */

.menu-wrapper {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  z-index: 20;
}

.dropdown-menu-right {
  left: auto;
  right: 0;
}

.hidden-menu {
  display: none;
}

.dropdown-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.3rem;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text);
}

.dropdown-item:hover {
  background: var(--hover-bg);
}

/* --- Main content --- */

.main {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 2rem 2rem;
}

.banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.banner-text {
  flex: 1;
}

.banner-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.banner-close:hover {
  opacity: 1;
}

.banner-error {
  background: var(--danger-soft);
  border: 1px solid #f6aea9;
  color: var(--danger);
}

.banner-notice {
  background: var(--success-soft);
  border: 1px solid #a8dab5;
  color: var(--success);
}

.breadcrumbs {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumbs-linked-btn {
  margin-left: auto;
  font-size: 0.85rem;
  white-space: nowrap;
}

.breadcrumbs a {
  text-decoration: none;
  color: var(--text);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.breadcrumbs a:hover {
  background: var(--hover-bg);
}

.crumb-sep {
  margin: 0 0.15rem;
  color: var(--muted);
}

.toolbar-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.hidden-bar {
  display: none;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-form input[type="text"] {
  flex: 1;
  min-width: 160px;
}

.inline-form button[type="submit"] {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-weight: 500;
}

.inline-form button[type="submit"]:hover {
  background: var(--accent-hover);
}

.btn-plain {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.5rem 0.6rem;
}

.btn-plain:hover {
  color: var(--text);
}

.file-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.entry-row:hover {
  background: var(--hover-bg);
}

.entry-row:hover .icon-btn {
  opacity: 1;
}

tbody tr:last-child td {
  border-bottom: none;
}

.entry-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.entry-icon {
  font-size: 1.1rem;
}

a.file-link,
.file-link-btn {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

a.file-link:hover,
.file-link-btn:hover {
  text-decoration: underline;
  color: var(--accent);
}

.file-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.entry-path {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.15rem;
  margin-left: 1.7rem;
}

.col-muted {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

td.actions {
  text-align: right;
  white-space: nowrap;
}

td.actions form {
  display: inline;
}

.icon-btn {
  opacity: 0.45;
  background: none;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
  margin-left: 0.2rem;
  transition: opacity 0.1s ease;
}

.icon-btn:hover {
  background: var(--border);
}

.icon-btn-danger:hover {
  background: var(--danger-soft);
}

.hidden-row {
  display: none;
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2.5rem 0;
}

/* --- Inventory --- */

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: capitalize;
}

.status-active {
  background: var(--success-soft);
  color: var(--success);
}

.status-deprecated {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-retired {
  background: var(--hover-bg);
  color: var(--muted);
}

.status-broken {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-to_be_fixed {
  background: var(--accent-soft);
  color: var(--accent);
}

/* --- Users --- */

.role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
}

.role-admin {
  background: var(--accent-soft);
  color: var(--accent);
}

.role-developer {
  background: var(--success-soft);
  color: var(--success);
}

.role-deployer {
  background: var(--warning-soft);
  color: var(--warning);
}

.role-qa {
  background: var(--hover-bg);
  color: var(--muted);
}

/* --- QA requests --- */

.qa-status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
}

.qa-status-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.qa-status-approved {
  background: var(--success-soft);
  color: var(--success);
}

.qa-status-issue {
  background: var(--danger-soft);
  color: var(--danger);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--hover-bg);
  border-radius: 14px;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
}

.chip a {
  color: var(--text);
  text-decoration: none;
}

.chip a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.chip form {
  display: inline;
  line-height: 0;
}

.chip-remove {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  font-size: 0.75rem;
  padding: 0;
  line-height: 1;
}

.chip-remove:hover {
  opacity: 1;
}

.checkbox-label {
  font-size: 0.85rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.status-cell {
  display: inline-flex;
  align-items: center;
}

.status-badge {
  cursor: pointer;
}

.status-cell .status-edit-form {
  display: none;
}

.status-cell.editing .status-badge {
  display: none;
}

.status-cell.editing .status-edit-form {
  display: inline-block;
}

.status-edit-form select {
  font-size: 0.78rem;
  padding: 0.15rem 0.4rem;
}

/* --- File location side panel --- */

.file-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  max-width: 90vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.2s ease;
}

.file-panel.hidden-panel {
  transform: translateX(100%);
}

.file-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 90;
}

.file-panel-overlay.hidden-panel {
  display: none;
}

/* --- Text file preview modal --- */
/* Centered, but same z-index/layer as the file panel and with no darkened
   backdrop of its own -- the two always open together (see handleFileClick
   in app.ts), so a second darkened overlay just for the preview would
   double up the dimming for no reason; the file panel's own overlay
   already covers it. */

.preview-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  max-width: 92vw;
  height: 80vh;
  max-height: 90vh;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-modal.hidden-panel {
  display: none;
}

.preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.preview-modal-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-modal-body {
  flex: 1;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.file-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.file-panel-content {
  padding: 1rem;
}

.file-panel-path {
  font-size: 0.85rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  word-break: break-word;
}

.file-panel-path a {
  color: var(--accent);
  text-decoration: none;
}

.file-panel-path a:hover {
  text-decoration: underline;
}

.file-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.file-panel-actions .btn-primary,
.file-panel-actions .btn-plain {
  text-align: center;
  text-decoration: none;
}

.file-panel-usage-header {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin: 1.25rem 0 0.5rem;
}

.file-panel-qa-line {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.file-note-form textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.file-filter-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--hover-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* --- Inventory multi-select + MQTT send --- */

.select-col {
  width: 2.2rem;
  padding-left: 1rem !important;
  padding-right: 0 !important;
}

.timestamp-col {
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--muted);
}

.device-info-line {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  padding: 0.6rem 0.6rem 0.6rem 1.1rem;
  z-index: 80;
}

.selection-bar.hidden-bar {
  display: none;
}

.section-header {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
}

.qa-toggle-row {
  display: flex;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.qa-toggle-btn {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.6;
}

.qa-toggle-btn:hover {
  opacity: 0.85;
}

.qa-toggle-btn.qa-toggle-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.qa-toggle-btn.qa-toggle-active:hover {
  opacity: 1;
}

.qa-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.qa-column .section-header {
  margin-top: 0;
}

.qa-column .file-list {
  overflow-x: auto;
}

.batch-attr-bar {
  position: fixed;
  left: 50%;
  bottom: 5rem;
  transform: translateX(-50%);
  z-index: 80;
  margin-bottom: 0;
  max-width: 92vw;
}

#selection-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.mqtt-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 92vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.2s ease;
}

.mqtt-modal.hidden-panel {
  transform: translateX(100%);
}

.mqtt-modal-content {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.mqtt-section-header {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin: 1.25rem 0 0.5rem;
}

.mqtt-section-header:first-child {
  margin-top: 0;
}

.mqtt-message-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.75rem;
}

.mqtt-message-caption {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.mqtt-message-topic {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  word-break: break-all;
}

.mqtt-message-payload {
  background: var(--hover-bg);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  font-size: 0.78rem;
  overflow-x: auto;
  white-space: pre;
}

.mqtt-modal-actions {
  margin-top: 1rem;
}

.mqtt-modal-actions .btn-primary {
  width: 100%;
  text-align: center;
}
