/* Semantic colors shared by marketing, authentication and the compact console. */
:root {
  color-scheme: light;
  --primary: #262626;
  --primary-light: #404040;
  --primary-dark: #404040;
  --on-primary: #ffffff;
  --secondary: #808080;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-subtle: #f5f5f5;
  --surface-hover: #ebebeb;
  --row-hover: #f8f8f8;
  --surface-border: #e5e5e5;
  --border-strong: #cccccc;
  --text: #262626;
  --text-secondary: #525252;
  --text-dim: #737373;
  --text-muted: #737373;
  --error: #ac3d37;
  --error-soft: #fff1ef;
  --error-border: #efc7c1;
  --success: #168451;
  --success-text: #176c45;
  --success-soft: #e8f5ed;
  --offline: #909090;
  --warning: #a56f21;
  --accent-soft: #ebebeb;
  --focus: #737373;
  --chart-memory: #6384c5;
  --chart-fill: rgba(23, 108, 69, 0.07);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #eeeeee;
  --primary-light: #ffffff;
  --primary-dark: #d4d4d4;
  --on-primary: #202020;
  --secondary: #a3a3a3;
  --bg: #141414;
  --surface: #1b1b1b;
  --surface-subtle: #222222;
  --surface-hover: #2d2d2d;
  --row-hover: #252525;
  --surface-border: #333333;
  --border-strong: #525252;
  --text: #eeeeee;
  --text-secondary: #d0d0d0;
  --text-dim: #aaaaaa;
  --text-muted: #a3a3a3;
  --error: #f19b91;
  --error-soft: #33201e;
  --error-border: #654039;
  --success: #69d6a0;
  --success-text: #93e2b9;
  --success-soft: #1c3829;
  --offline: #858585;
  --warning: #e0b66d;
  --accent-soft: #2d2d2d;
  --focus: #a3a3a3;
  --chart-memory: #93afe6;
  --chart-fill: rgba(105, 214, 160, 0.08);
}
:focus-visible {
  outline-color: var(--focus);
}
input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
select {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--surface-border);
}
.btn-primary {
  color: var(--on-primary);
}
.sidebar-link.active,
.preview-nav.selected {
  background: var(--accent-soft);
  color: var(--primary);
}
.status-online,
.fleet-health .status-online {
  color: var(--text-secondary);
}
.machine-table .status-online {
  background: var(--surface-subtle);
}
.metric-meter > span,
.mini-meter > span {
  background: var(--success);
}
.machine-table td:nth-child(4) .metric-meter > span {
  background: var(--chart-memory);
}
.machine-table .metric.high .metric-meter > span {
  background: var(--warning);
}
.hero h1 > span {
  color: var(--primary);
}
.brand img {
  border-radius: 0;
}
[data-theme="dark"] .brand img,
[data-theme="dark"] .orbit-center img {
  outline: none;
  content: url("brand-dark.svg");
}
.auth-appearance,
.appearance-control {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.appearance-control {
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--surface-border);
}
.appearance-control select {
  max-width: 102px;
}
.auth-appearance {
  justify-content: flex-end;
  margin-bottom: 28px;
}
[data-theme-select] {
  height: 34px;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 12px;
  width: 94px;
}
.nav-actions {
  gap: 16px;
}
.mobile-workspace-nav,
.mobile-header,
.menu-close {
  display: none;
}
.mobile-menu {
  color: var(--text);
  border: 1px solid var(--surface-border);
  background: var(--surface);
}
.mobile-menu::backdrop {
  background: rgb(0 0 0 / 55%);
  backdrop-filter: blur(3px);
}
body.menu-open {
  overflow: hidden;
}
@media (max-width: 768px) {
  .mobile-workspace-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
    padding: 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--surface-border);
  }
  .mobile-workspace-nav a {
    flex: 0 0 auto;
    padding-inline: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
  }
  .mobile-workspace-nav a[aria-current="page"] {
    color: var(--text);
    background: var(--surface-hover);
    box-shadow: inset 0 0 0 1px var(--surface-border);
  }
  .mobile-workspace-nav .icon { width: 18px; height: 18px; }
  .console .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    height: 62px;
    background: var(--surface);
    border-bottom: 1px solid var(--surface-border);
  }
  .console .mobile-header .brand {
    font-size: 23px;
  }
  .console .mobile-header .brand img {
    width: 28px;
    height: 28px;
  }
  .console .mobile-header .icon-button {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
  }
  .console .mobile-header .icon {
    width: 22px;
    height: 22px;
  }
  .console > .sidebar {
    display: none;
  }
  .console .console-body {
    margin-left: 0;
  }
  .console .console-main {
    padding: 20px 16px 28px;
  }
  .mobile-menu {
    position: fixed;
    inset: 0 0 0 auto;
    margin: 0;
    width: min(320px, calc(100% - 24px));
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    border-width: 0 0 0 1px;
    border-radius: 18px 0 0 18px;
    overflow: auto;
  }
  .console .mobile-menu .sidebar {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    padding: 22px 16px max(12px, env(safe-area-inset-bottom));
    border: 0;
    background: var(--surface);
  }
  .console .mobile-menu .sidebar > .brand {
    margin: 4px 6px 28px;
    font-size: 24px;
    align-self: flex-start;
  }
  .console .mobile-menu .menu-close {
    display: inline-flex;
    position: absolute;
    right: 12px;
    top: 14px;
    width: 42px;
    height: 42px;
    border: 0;
  }
  .console .mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .console .mobile-menu .sidebar-link {
    padding: 12px;
    min-height: 44px;
    font-size: 14px;
    gap: 12px;
  }
  .console .mobile-menu .sidebar-link .icon {
    width: 18px;
    height: 18px;
  }
  .console .mobile-menu .sidebar-bottom {
    margin-top: auto;
    padding-top: 24px;
  }
  .console .mobile-menu .account-row {
    padding: 16px 0 0;
    gap: 10px;
    align-items: center;
  }
  .console .mobile-menu .account-row > div {
    max-width: none;
  }
  .console .mobile-menu .account-row strong {
    font-size: 12px;
  }
  .console .mobile-menu .account-row small {
    font-size: 11px;
  }
  .console .mobile-menu .account-row .workspace-avatar {
    display: inline-flex;
    width: 30px;
    height: 30px;
  }
  .console .mobile-menu .account-row .icon-button {
    width: 42px;
    height: 42px;
  }
  .console .mobile-menu .appearance-control {
    padding: 14px 0;
    font-size: 13px;
  }
  .console .mobile-menu .appearance-control select {
    height: 42px;
    font-size: 14px;
  }
}
@media (max-width: 640px) {
  .nav-actions > .btn-primary {
    display: none;
  }
  .nav-actions {
    gap: 12px;
  }
  .nav-actions [data-theme-select] {
    height: 40px;
    width: 86px;
  }
  .auth-appearance [data-theme-select] {
    height: 40px;
  }
  .console input:not([type="checkbox"]),
  .auth-container input {
    font-size: 16px;
  }
}
