:root {
  --ovm-sidebar-width: 232px;
  --ovm-sidebar-compact: 76px;
  --ovm-topbar-height: 58px;
  --ovm-border: rgba(15, 23, 42, .11);
  --ovm-soft: #f4f7fb;
  --ovm-accent: #0ea5e9;
  --ovm-ok: #16a34a;
  --ovm-warn: #f59e0b;
  --ovm-danger: #dc2626;
}

html,
body {
  min-height: 100%;
}

body {
  font-size: .92rem;
  padding-bottom: 42px;
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  background: #111827;
  border-right: 1px solid rgba(255, 255, 255, .08);
  bottom: 0;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  left: 0;
  overflow: hidden;
  padding: .85rem .65rem;
  position: fixed;
  top: 0;
  transition: width .18s ease, transform .18s ease;
  width: var(--ovm-sidebar-width);
  z-index: 1040;
}

.app-brand {
  align-items: center;
  color: #fff;
  display: flex;
  gap: .65rem;
  min-height: 38px;
  padding: .2rem .35rem .75rem;
  text-decoration: none;
}

.app-logo {
  border-radius: 10px;
  flex: 0 0 34px;
  height: 34px;
  width: 34px;
}

.app-brand-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.app-nav {
  display: grid;
  gap: .2rem;
  margin-top: .5rem;
}

.app-nav-link,
.sidebar-toggle {
  align-items: center;
  border: 0;
  border-radius: 8px;
  color: #d1d5db;
  display: flex;
  gap: .65rem;
  min-height: 38px;
  padding: .5rem .6rem;
  text-decoration: none;
}

.app-nav-link:hover,
.app-nav-link.active,
.sidebar-toggle:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.nav-icon {
  align-items: center;
  background: rgba(255, 255, 255, .08);
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 28px;
  font-size: .72rem;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle {
  background: transparent;
  margin-top: auto;
  width: 100%;
}

.sidebar-collapsed .app-sidebar {
  width: var(--ovm-sidebar-compact);
}

.sidebar-collapsed .app-brand-text,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-toggle-label {
  display: none;
}

.sidebar-collapsed .app-nav-link,
.sidebar-collapsed .sidebar-toggle,
.sidebar-collapsed .app-brand {
  justify-content: center;
}

.app-main {
  margin-left: var(--ovm-sidebar-width);
  min-width: 0;
  transition: margin-left .18s ease;
}

.sidebar-collapsed .app-main {
  margin-left: var(--ovm-sidebar-compact);
}

.app-topbar {
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(248, 250, 252, .92);
  border-bottom: 1px solid var(--ovm-border);
  display: flex;
  gap: .75rem;
  min-height: var(--ovm-topbar-height);
  padding: .65rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

[data-bs-theme="dark"] .app-topbar {
  background: rgba(17, 24, 39, .92);
  border-color: rgba(255, 255, 255, .09);
}

.app-content {
  margin: 0 auto;
  max-width: 1480px;
  padding: 1.2rem;
}

.mobile-menu-btn {
  display: none;
}

.icon-btn {
  align-items: center;
  display: inline-flex;
  gap: .35rem;
  justify-content: center;
  min-height: 34px;
}

.page-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0;
}

.page-subtitle {
  color: var(--bs-secondary-color);
  margin: .15rem 0 0;
}

.surface,
.stat-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--ovm-border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

[data-bs-theme="dark"] .surface,
[data-bs-theme="dark"] .stat-card {
  border-color: rgba(255, 255, 255, .1);
  box-shadow: none;
}

.surface {
  padding: 1rem;
}

.surface-tight {
  padding: .75rem;
}

.surface-header {
  align-items: center;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  margin-bottom: .85rem;
}

.stat-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.stat-card {
  padding: .9rem;
}

.stat-label {
  color: var(--bs-secondary-color);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: .25rem;
}

.stat-meta {
  color: var(--bs-secondary-color);
  font-size: .82rem;
  margin-top: .2rem;
}

.host-load-list {
  display: grid;
  gap: .75rem;
}

.host-load-row {
  border: 1px solid var(--ovm-border);
  border-radius: 8px;
  display: grid;
  gap: .9rem;
  grid-template-columns: minmax(170px, 1.1fr) repeat(3, minmax(150px, 1fr));
  padding: .85rem;
}

[data-bs-theme="dark"] .host-load-row {
  border-color: rgba(255, 255, 255, .1);
}

.metric-line {
  min-width: 0;
}

.metric-line-head {
  align-items: center;
  display: flex;
  font-size: .78rem;
  justify-content: space-between;
  margin-bottom: .35rem;
}

.metric-track {
  background: rgba(148, 163, 184, .22);
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.metric-fill {
  background: var(--ovm-accent);
  border-radius: inherit;
  height: 100%;
  min-width: 2px;
}

.metric-fill.ok {
  background: var(--ovm-ok);
}

.metric-fill.warn {
  background: var(--ovm-warn);
}

.metric-fill.danger {
  background: var(--ovm-danger);
}

.metric-detail {
  color: var(--bs-secondary-color);
  font-size: .75rem;
  margin-top: .3rem;
}

.table {
  margin-bottom: 0;
}

.table th {
  color: var(--bs-secondary-color);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.actions-cell {
  white-space: nowrap;
}

.form-control,
.form-select,
.btn {
  border-radius: 7px;
}

.btn-sm {
  --bs-btn-border-radius: 7px;
}

.nav-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.terminal-box {
  min-height: 360px;
}

.ovm-cpu-chart-box {
  height: 76px;
  max-height: 76px;
  min-height: 76px;
  position: relative;
}

.ovm-cpu-chart-box canvas {
  display: block;
  height: 100% !important;
  max-height: 76px !important;
  width: 100% !important;
}

.sidebar-backdrop {
  background: rgba(15, 23, 42, .42);
  bottom: 0;
  display: none;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1035;
}

.app-footer {
  bottom: 0;
  left: var(--ovm-sidebar-width);
  position: fixed;
  right: 0;
  z-index: 1030;
}

.sidebar-collapsed .app-footer {
  left: var(--ovm-sidebar-compact);
}

@media (max-width: 1199.98px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .host-load-row {
    grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 991.98px) {
  body {
    font-size: .9rem;
  }

  .app-sidebar {
    transform: translateX(-100%);
    width: min(84vw, 292px);
  }

  .sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .sidebar-collapsed .app-sidebar {
    width: min(84vw, 292px);
  }

  .sidebar-collapsed .app-brand-text,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .sidebar-toggle-label {
    display: inline;
  }

  .sidebar-collapsed .app-nav-link,
  .sidebar-collapsed .sidebar-toggle,
  .sidebar-collapsed .app-brand {
    justify-content: flex-start;
  }

  .desktop-sidebar-toggle {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .app-main,
  .sidebar-collapsed .app-main {
    margin-left: 0;
  }

  .app-topbar {
    padding: .55rem .8rem;
  }

  .app-content {
    padding: .85rem;
  }

  .app-footer,
  .sidebar-collapsed .app-footer {
    left: 0;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
    gap: .75rem;
  }

  .host-load-row {
    grid-template-columns: 1fr;
  }
}

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

  .surface {
    padding: .8rem;
  }

  .responsive-table table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table th,
  .responsive-table td,
  .responsive-table tr {
    display: block;
    width: 100%;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody tr {
    border: 1px solid var(--ovm-border);
    border-radius: 8px;
    margin-bottom: .75rem;
    padding: .45rem .6rem;
  }

  [data-bs-theme="dark"] .responsive-table tbody tr {
    border-color: rgba(255, 255, 255, .1);
  }

  .responsive-table td {
    align-items: start;
    border: 0;
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
    padding: .35rem 0;
    white-space: normal;
  }

  .responsive-table td::before {
    color: var(--bs-secondary-color);
    content: attr(data-label);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .responsive-table td.actions-cell {
    display: block;
  }

  .responsive-table td.actions-cell::before {
    display: block;
    margin-bottom: .45rem;
  }

  .actions-cell .btn,
  .actions-cell form {
    margin-bottom: .35rem;
  }

  .btn-toolbar-mobile {
    align-items: stretch;
    flex-direction: column;
  }

  .btn-toolbar-mobile .btn,
  .btn-toolbar-mobile form,
  .btn-toolbar-mobile input {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .app-topbar .signed-in {
    display: none;
  }

  .page-title {
    font-size: 1.25rem;
  }

.stat-value {
font-size: 1.5rem;
}
}

.ovm-icon-btn {
  width: 1.75rem;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ovm-icon-btn.copied {
  border-color: var(--bs-success);
  color: var(--bs-success);
}

.ovm-copy-glyph {
  position: relative;
  width: .95rem;
  height: .95rem;
  display: inline-block;
}

.ovm-copy-glyph::before,
.ovm-copy-glyph::after {
  content: "";
  position: absolute;
  width: .58rem;
  height: .72rem;
  border: 1.5px solid currentColor;
  border-radius: .16rem;
  background: var(--bs-body-bg);
}

.ovm-copy-glyph::before {
  left: .12rem;
  top: .22rem;
  opacity: .65;
}

.ovm-copy-glyph::after {
  left: .28rem;
  top: .04rem;
}

.ovm-secret-box {
  display: block;
  min-height: 2.25rem;
  padding: .45rem .6rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .375rem;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  overflow-wrap: anywhere;
}
