html {
  font-size: 16px;
}

body {
  margin: 0;
}

.app-container {
  box-sizing: border-box;
  max-width: 96rem;
  padding-left: 1rem;
  padding-right: 1rem;
  transition: max-width 0.18s ease, padding-left 0.18s ease, padding-right 0.18s ease;
}

html[data-layout-mode="compact"] .app-container {
  max-width: 80rem;
}

html[data-layout-mode="wide"] .app-container {
  max-width: 96rem;
}

html[data-layout-mode="full"] .app-container {
  max-width: none;
  padding-left: 1rem;
  padding-right: 1rem;
}

.layout-mode-menu {
  min-height: 2.25rem;
}

.layout-mode-menu summary {
  list-style: none;
}

.layout-mode-menu summary::-webkit-details-marker {
  display: none;
}

.layout-mode-current {
  color: #0f766e;
}

.layout-mode-chevron {
  color: #64748b;
  transition: transform 0.16s ease;
}

.layout-mode-menu[open] .layout-mode-chevron {
  transform: rotate(180deg);
}

.layout-mode-panel {
  min-width: 12rem;
}

.layout-mode-option {
  border-radius: 0.65rem;
  color: #475569;
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  text-align: left;
  transition: background-color 0.16s ease, color 0.16s ease;
  width: 100%;
}

.layout-mode-option span {
  font-size: 0.82rem;
  font-weight: 800;
}

.layout-mode-option small {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
}

.layout-mode-option:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.layout-mode-option.layout-mode-active {
  background: #ccfbf1;
  color: #115e59;
}

.layout-mode-option.layout-mode-active small {
  color: #0f766e;
}

.dark .layout-mode-current {
  color: #5eead4;
}

.dark .layout-mode-chevron,
.dark .layout-mode-option small {
  color: #94a3b8;
}

.dark .layout-mode-option {
  color: #cbd5e1;
}

.dark .layout-mode-option:hover {
  background: #1e293b;
  color: #ffffff;
}

.dark .layout-mode-option.layout-mode-active {
  background: #134e4a;
  color: #ccfbf1;
}

.dark .layout-mode-option.layout-mode-active small {
  color: #99f6e4;
}

@media (min-width: 640px) {
  .app-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  html[data-layout-mode="full"] .app-container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .app-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  html[data-layout-mode="full"] .app-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.status-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
}

.status-ok {
  background: #dcfce7;
  color: #166534;
}

.status-fail {
  background: #fee2e2;
  color: #991b1b;
}

.status-muted {
  background: #e2e8f0;
  color: #475569;
}

.unknown-device-row {
  background: #fff7ed;
}

.unknown-device-row:hover {
  background: #ffedd5;
}

.alert-stream {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.alert-item {
  border-left: 4px solid #dc2626;
  padding-left: 0.75rem;
}

.alert-item strong,
.alert-item span,
.alert-item small {
  display: block;
}

.alert-item strong {
  color: #991b1b;
  font-size: 0.875rem;
}

.alert-item span {
  color: #334155;
  font-size: 0.875rem;
  margin-top: 0.15rem;
}

.alert-item small,
.empty-state {
  color: #64748b;
  font-size: 0.875rem;
}

#recentLogs td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  white-space: nowrap;
}

#recentLogs td:nth-child(3) {
  white-space: normal;
}

#recentLogs small {
  color: #64748b;
  display: block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dark [class*="bg-white"] {
  background-color: #0f172a !important;
}

.dark [class*="bg-slate-50"],
.dark [class*="bg-slate-100"] {
  background-color: #111827 !important;
}

.dark [class*="border-slate-200"],
.dark [class*="border-slate-300"],
.dark [class*="border-white"] {
  border-color: #1e293b !important;
}

.dark [class*="text-slate-950"],
.dark [class*="text-slate-900"],
.dark [class*="text-slate-800"],
.dark [class*="text-slate-700"] {
  color: #f8fafc !important;
}

.dark [class*="text-slate-600"],
.dark [class*="text-slate-500"] {
  color: #cbd5e1 !important;
}

.dark input,
.dark select,
.dark textarea {
  background-color: #020617 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
  color: #94a3b8 !important;
}

.dark thead {
  background-color: #111827 !important;
}

.dark tbody {
  background-color: #0f172a !important;
}

.dark tr {
  border-color: #1e293b !important;
}

.dark code,
.dark pre {
  background-color: #020617;
  color: #e2e8f0;
}

.dark .unknown-device-row {
  background: #422006 !important;
}

.dark .unknown-device-row:hover {
  background: #713f12 !important;
}

.dark .status-ok {
  background: #064e3b;
  color: #a7f3d0;
}

.dark .status-fail {
  background: #7f1d1d;
  color: #fecaca;
}

.dark .status-muted {
  background: #334155;
  color: #cbd5e1;
}

.dark .alert-item span {
  color: #cbd5e1;
}

.dark .alert-item small,
.dark .empty-state,
.dark #recentLogs small {
  color: #94a3b8;
}
