:root {
  --ms-bg: #f2f4f6;
  --ms-surface: #ffffff;
  --ms-surface-soft: #f8f9fb;
  --ms-surface-strong: #eef1f4;
  --ms-border: #dfe3e8;
  --ms-border-strong: #cfd5dc;
  --ms-text: #1f2933;
  --ms-text-soft: #596575;
  --ms-muted: #85909e;
  --ms-primary: #2867d6;
  --ms-primary-soft: #edf4ff;
  --ms-success: #16865f;
  --ms-success-soft: #eaf7f1;
  --ms-warning: #c47a12;
  --ms-warning-soft: #fff6e7;
  --ms-danger: #cf4545;
  --ms-danger-soft: #fff0f0;
  --ms-violet: #7357bd;
  --ms-radius: 6px;
  --ms-shadow: 0 10px 30px rgba(31, 41, 51, 0.08);
  --ms-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ms-fast: 120ms;
  --ms-normal: 200ms;
  --ms-slow: 280ms;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  color: var(--ms-text);
  background: var(--ms-bg);
}

body {
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

[v-cloak] {
  display: none;
}

/* Login */
.login-container {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  padding: 88px 24px 72px;
  background: #edf0f3;
  overflow: hidden;
}

.login-container::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.62;
  background-size: 32px 32px;
  background-image:
    linear-gradient(rgba(72, 84, 99, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 84, 99, 0.055) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 88%);
}

.login-container::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: -1;
  height: 5px;
  background: var(--ms-primary);
}

.login-brand-corner {
  position: absolute;
  top: 30px;
  left: 34px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ms-text);
  animation: ms-fade-down 360ms var(--ms-ease) both;
}

.login-brand-mark,
.header-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: var(--ms-radius);
  background: var(--ms-text);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(31, 41, 51, 0.16);
}

.login-brand-corner strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.login-brand-corner span {
  display: block;
  margin-top: 3px;
  color: var(--ms-muted);
  font-size: 11px;
}

.login-box {
  position: relative;
  width: min(440px, 100%);
  padding: 34px 36px 30px;
  border: 1px solid var(--ms-border);
  border-radius: 8px;
  background: var(--ms-surface);
  box-shadow: var(--ms-shadow);
  text-align: left;
  animation: ms-login-enter 440ms var(--ms-ease) both;
}

.login-box.is-checking {
  padding-top: 46px;
  padding-bottom: 44px;
  text-align: center;
}

.login-heading {
  margin-bottom: 25px;
}

.login-heading-kicker {
  color: var(--ms-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-heading h1 {
  margin: 8px 0 7px;
  color: var(--ms-text);
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: 0;
}

.login-heading p {
  margin: 0;
  color: var(--ms-muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-readiness {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 24px;
  padding: 10px 12px;
  border: 1px solid #d7ebe3;
  border-radius: var(--ms-radius);
  background: var(--ms-success-soft);
  color: var(--ms-success);
  font-size: 12px;
  font-weight: 700;
}

.login-readiness-dot,
.engine-state-dot,
.connection-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.login-readiness-dot {
  animation: ms-pulse 1.8s ease-in-out infinite;
}

.login-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface-strong);
}

.login-mode-button {
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ms-text-soft);
  cursor: pointer;
  transition: color var(--ms-fast), background var(--ms-fast), box-shadow var(--ms-fast);
}

.login-mode-button.is-active {
  background: #fff;
  color: var(--ms-primary);
  font-weight: 800;
  box-shadow: 0 2px 7px rgba(31, 41, 51, 0.1);
}

.login-form-field {
  margin-bottom: 16px;
}

.login-form-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ms-text-soft);
  font-size: 12px;
  font-weight: 700;
}

.login-box .el-input__wrapper {
  min-height: 44px;
  border-radius: var(--ms-radius);
  box-shadow: 0 0 0 1px var(--ms-border) inset;
  transition: box-shadow var(--ms-fast), background var(--ms-fast);
}

.login-box .el-input__wrapper:hover {
  box-shadow: 0 0 0 1px var(--ms-border-strong) inset;
}

.login-box .el-input__wrapper.is-focus {
  box-shadow: 0 0 0 1px var(--ms-primary) inset, 0 0 0 3px rgba(40, 103, 214, 0.11);
}

.login-guest-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 96px;
  margin-bottom: 17px;
  padding: 16px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface-soft);
}

.login-guest-panel .el-icon {
  margin-top: 2px;
  color: var(--ms-primary);
  font-size: 22px;
}

.login-guest-panel strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ms-text);
}

.login-guest-panel span {
  color: var(--ms-muted);
  font-size: 12px;
  line-height: 1.6;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #f5caca;
  border-radius: var(--ms-radius);
  background: var(--ms-danger-soft);
  color: var(--ms-danger);
  font-size: 12px;
  line-height: 1.5;
  animation: ms-error-nudge 220ms ease-out both;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  border-radius: var(--ms-radius);
  font-weight: 800;
}

.login-submit.el-button--primary {
  --el-button-bg-color: var(--ms-primary);
  --el-button-border-color: var(--ms-primary);
  --el-button-hover-bg-color: #1f5cbd;
  --el-button-hover-border-color: #1f5cbd;
}

.login-security-note {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--ms-muted);
  font-size: 11px;
}

.login-footer {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  color: var(--ms-muted);
  font-size: 11px;
  white-space: nowrap;
}

.login-check-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid #dce5f4;
  border-top-color: var(--ms-primary);
  border-radius: 50%;
  animation: ms-spin 800ms linear infinite;
}

/* Shell */
.app-layout-root {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--ms-bg);
}

.el-header.ms-header {
  position: relative;
  z-index: 40;
  height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid var(--ms-border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.ms-header-left,
.ms-header-actions,
.ms-header-brand,
.ms-header-context,
.engine-state {
  display: flex;
  align-items: center;
}

.ms-header-left {
  min-width: 0;
  gap: 12px;
}

.ms-header-actions {
  flex: 0 0 auto;
  gap: 10px;
}

.header-icon-button {
  width: 36px;
  height: 36px;
  border-color: var(--ms-border);
  color: var(--ms-text-soft);
}

.ms-header-brand {
  min-width: 0;
  gap: 10px;
}

.header-brand-mark {
  width: 34px;
  height: 34px;
  font-size: 16px;
  box-shadow: none;
}

.header-brand-copy {
  min-width: 0;
}

.header-brand-copy strong {
  display: block;
  color: var(--ms-text);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.header-brand-copy span {
  display: block;
  margin-top: 3px;
  color: var(--ms-muted);
  font-size: 10px;
  white-space: nowrap;
}

.ms-header-divider {
  width: 1px;
  height: 30px;
  margin: 0 4px;
  background: var(--ms-border);
}

.ms-header-context {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.ms-header-context strong {
  max-width: 300px;
  overflow: hidden;
  color: var(--ms-text);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-header-context span {
  max-width: 360px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ms-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-state {
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #cee7dc;
  border-radius: var(--ms-radius);
  background: var(--ms-success-soft);
  color: var(--ms-success);
  font-size: 11px;
  font-weight: 800;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface-soft);
  color: var(--ms-text-soft);
  font-size: 11px;
  font-weight: 800;
}

.header-task-badge .el-badge__content {
  border: 2px solid #fff;
  background: var(--ms-danger);
}

.task-popover {
  padding: 4px 2px;
}

.task-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.task-popover-head strong {
  color: var(--ms-text);
  font-size: 14px;
}

.task-popover-head span {
  color: var(--ms-muted);
  font-size: 11px;
}

.task-summary-list {
  display: grid;
  gap: 7px;
}

.task-summary-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface-soft);
}

.task-summary-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ms-primary);
}

.task-summary-dot.is-warning {
  background: var(--ms-warning);
}

.task-summary-dot.is-violet {
  background: var(--ms-violet);
}

.task-summary-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--ms-text-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-summary-row b {
  color: var(--ms-text);
  font-size: 12px;
}

.task-popover-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.app-layout-body {
  min-width: 0;
  height: calc(100vh - 64px);
  min-height: 0;
  background: var(--ms-bg);
}

.app-sidebar {
  height: calc(100vh - 64px);
  border-right: 1px solid var(--ms-border);
  background: var(--ms-surface);
  transition: width var(--ms-normal) var(--ms-ease);
}

.app-sidebar .el-menu {
  padding: 10px 8px 8px;
  border-right: 0;
  background: transparent;
}

.app-sidebar .el-menu-item {
  height: 42px;
  margin: 2px 0;
  border-radius: var(--ms-radius);
  color: var(--ms-text-soft);
  font-size: 13px;
  font-weight: 700;
  transition: color var(--ms-fast), background var(--ms-fast), transform var(--ms-fast);
}

.app-sidebar .el-menu-item:hover {
  background: var(--ms-surface-strong);
  color: var(--ms-text);
}

.app-sidebar .el-menu-item.is-active {
  background: var(--ms-primary-soft);
  color: var(--ms-primary);
}

.app-sidebar .el-menu-item .el-icon {
  color: currentColor;
  font-size: 18px;
}

.app-sidebar .el-menu--collapse {
  width: auto;
}

.sidebar-section-label {
  margin: 12px 12px 6px;
  color: var(--ms-muted);
  font-size: 10px;
  font-weight: 800;
}

.app-sidebar.is-collapsed .sidebar-section-label {
  height: 1px;
  margin: 7px 10px;
  overflow: hidden;
  background: var(--ms-border);
  color: transparent;
}

.system-status-panel {
  margin: 10px;
  padding: 12px;
  border-color: var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface-soft);
}

.system-status-head {
  margin-bottom: 9px;
  color: var(--ms-text);
}

.system-status-meter {
  margin-top: 9px;
}

.system-status-row,
.system-status-row b,
.system-status-speed b {
  color: var(--ms-text-soft);
}

.system-status-sub,
.system-status-speed span {
  color: var(--ms-muted);
}

.el-main.ms-main {
  height: calc(100vh - 64px);
  padding: 20px 22px 34px;
  background: var(--ms-bg);
  scroll-behavior: smooth;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
}

.workspace-eyebrow {
  margin-bottom: 5px;
  color: var(--ms-primary);
  font-size: 10px;
  font-weight: 900;
}

.workspace-heading h1 {
  margin: 0;
  color: var(--ms-text);
  font-size: 22px;
  line-height: 1.3;
}

.workspace-heading p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--ms-muted);
  font-size: 12px;
  line-height: 1.55;
}

.workspace-view {
  min-width: 0;
}

.workspace-enter-active,
.workspace-leave-active {
  transition: opacity 160ms ease, transform 180ms var(--ms-ease);
}

.workspace-enter-from {
  opacity: 0;
  transform: translateY(6px);
}

.workspace-leave-to {
  opacity: 0;
  transform: translateY(-3px);
}

/* Metrics and operational surfaces */
.dashboard-metrics-row {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px !important;
}

.dashboard-metrics-row.is-guest {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-metrics-row::before,
.dashboard-metrics-row::after {
  display: none;
}

.dashboard-metrics-row .el-col {
  display: block;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
}

.metric-card {
  position: relative;
  min-height: 108px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface);
  box-shadow: none;
  text-align: left;
  transition: border-color var(--ms-fast), box-shadow var(--ms-normal), transform var(--ms-fast);
  animation: ms-surface-enter 360ms var(--ms-ease) both;
}

.dashboard-metrics-row .el-col:nth-child(2) .metric-card { animation-delay: 35ms; }
.dashboard-metrics-row .el-col:nth-child(3) .metric-card { animation-delay: 70ms; }
.dashboard-metrics-row .el-col:nth-child(4) .metric-card { animation-delay: 105ms; }
.dashboard-metrics-row .el-col:nth-child(5) .metric-card { animation-delay: 140ms; }
.dashboard-metrics-row .el-col:nth-child(6) .metric-card { animation-delay: 175ms; }

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--ms-primary);
}

.dashboard-metrics-row .el-col:nth-child(3n) .metric-card::before {
  background: var(--ms-success);
}

.dashboard-metrics-row .el-col:nth-child(5n) .metric-card::before {
  background: var(--ms-warning);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--ms-border-strong);
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.07);
}

.metric-title {
  margin: 0 0 10px;
  color: var(--ms-muted);
  font-size: 11px;
  font-weight: 800;
}

.metric-value {
  color: var(--ms-text);
  font-size: 22px;
  line-height: 1.2;
}

.metric-sub-link {
  margin-top: 7px;
  color: var(--ms-warning);
  text-decoration: none;
}

.realtime-status-bar,
.resource-toolbar,
.log-card-header {
  min-width: 0;
}

.realtime-status-bar {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface);
}

.realtime-live-copy {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--ms-text-soft);
  font-size: 12px;
}

.realtime-live-copy strong {
  color: var(--ms-text);
}

.connection-indicator {
  color: var(--ms-success);
}

.connection-indicator.is-connecting {
  color: var(--ms-warning);
  animation: ms-pulse 1.1s ease-in-out infinite;
}

.realtime-grid {
  gap: 10px;
  margin-bottom: 14px;
}

.realtime-card,
.backup-card,
.backup-setting-field,
.task-action-card,
.seven-day-ingest-card {
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface);
  box-shadow: none;
}

.realtime-card {
  min-height: 148px;
  padding: 15px;
}

.realtime-card-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--ms-border-strong);
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.07);
}

.realtime-card-title,
.seven-day-card-header,
.backup-setting-title {
  color: var(--ms-text);
}

.realtime-big {
  color: var(--ms-text);
  font-size: 26px;
}

.realtime-sub,
.realtime-click-hint {
  color: var(--ms-muted);
}

.realtime-click-hint {
  color: var(--ms-primary);
}

.seven-day-ingest-card .el-card__header,
.seven-day-ingest-card .el-card__body {
  padding: 14px 16px;
}

.seven-day-card-badge {
  min-width: 38px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--ms-radius);
  background: var(--ms-primary-soft);
  color: var(--ms-primary);
  box-shadow: none;
}

.el-card {
  border-color: var(--ms-border);
  border-radius: var(--ms-radius);
  box-shadow: none;
}

.el-card__header {
  border-bottom-color: var(--ms-border);
}

.el-tabs--border-card {
  border-color: var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface);
  box-shadow: none;
}

.el-tabs--border-card > .el-tabs__header {
  border-bottom-color: var(--ms-border);
  background: var(--ms-surface-soft);
}

.el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
  color: var(--ms-primary);
  font-weight: 800;
}

.el-table {
  --el-table-border-color: var(--ms-border);
  --el-table-header-bg-color: var(--ms-surface-soft);
  --el-table-row-hover-bg-color: #f4f7fb;
  --el-table-current-row-bg-color: var(--ms-primary-soft);
  color: var(--ms-text-soft);
}

.el-table th.el-table__cell {
  color: var(--ms-text-soft);
  font-size: 12px;
  font-weight: 800;
}

.el-table .el-table__row {
  transition: background var(--ms-fast), opacity var(--ms-normal), transform var(--ms-normal);
}

.el-table .el-table__row:hover {
  transform: translateX(1px);
}

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

.status-success { background: var(--ms-success); }
.status-queued { background: var(--ms-primary); }
.status-error { background: var(--ms-danger); }

.resource-toolbar {
  position: sticky;
  top: -20px;
  z-index: 8;
  margin: -2px -2px 14px;
  padding: 14px 2px 12px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--ms-border);
}

.resource-toolbar-title {
  color: var(--ms-text);
  font-size: 14px;
}

.resource-toolbar-desc {
  max-width: 820px;
  color: var(--ms-muted);
}

.el-button {
  border-radius: var(--ms-radius);
  transition: color var(--ms-fast), background var(--ms-fast), border-color var(--ms-fast), transform var(--ms-fast);
}

.el-button:active:not(.is-disabled) {
  transform: translateY(1px);
}

.el-input__wrapper,
.el-textarea__inner,
.el-select__wrapper {
  border-radius: var(--ms-radius);
}

.el-dialog {
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(31, 41, 51, 0.2);
}

.el-dialog__header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ms-border);
}

/* Config */
.config-group-card {
  margin-bottom: 12px;
  border-color: var(--ms-border);
  border-radius: var(--ms-radius);
  box-shadow: none;
}

.config-group-header {
  min-height: 66px;
  padding: 14px 16px;
  border-left: 3px solid var(--ms-primary);
  background: var(--ms-surface);
}

.config-group-title {
  color: var(--ms-text);
  font-size: 14px;
}

.config-group-description,
.config-desc,
.config-secret-note {
  color: var(--ms-muted);
}

.config-group-body {
  padding: 10px 14px 16px;
  border-top-color: var(--ms-border);
  background: var(--ms-surface-soft);
}

.config-card-item {
  min-height: 0;
  margin-bottom: 0;
  padding: 13px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.config-card-item .el-form-item__label {
  margin-bottom: 6px;
  color: var(--ms-text);
}

.config-switch-row {
  min-height: 48px;
  padding: 9px 11px;
  border-color: var(--ms-border);
  border-radius: var(--ms-radius);
}

.config-action-panel,
.release-auto-detected-panel {
  border-color: var(--ms-border);
  border-radius: var(--ms-radius);
  background: var(--ms-surface);
}

.release-auto-detected-item,
.release-auto-detected-empty {
  border-radius: var(--ms-radius);
  background: var(--ms-surface-soft);
}

.config-save-bar {
  position: sticky;
  bottom: -34px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px -20px -20px;
  padding: 13px 20px;
  border-top: 1px solid var(--ms-border);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -10px 24px rgba(31, 41, 51, 0.06);
}

.config-save-copy strong {
  display: block;
  color: var(--ms-text);
  font-size: 13px;
}

.config-save-copy span {
  display: block;
  margin-top: 3px;
  color: var(--ms-muted);
  font-size: 11px;
}

/* Logs */
.terminal-box {
  border: 1px solid #2a3038;
  border-radius: var(--ms-radius);
  background: #171a1f;
  color: #d8dde5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  line-height: 1.68;
  scrollbar-color: #46505e #171a1f;
}

.log-info {
  color: #d8dde5;
  font-weight: 400;
}

.log-warn {
  color: #f0bd62;
}

.log-error {
  color: #ff7777;
}

.log-card-title {
  color: var(--ms-text);
}

code {
  border-radius: 4px;
  background: var(--ms-surface-strong);
  color: #42516a;
}

/* Motion */
@keyframes ms-login-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ms-fade-down {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ms-surface-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ms-pulse {
  0%, 100% { opacity: 0.42; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes ms-spin {
  to { transform: rotate(360deg); }
}

@keyframes ms-error-nudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-2px); }
  70% { transform: translateX(2px); }
}

/* Responsive */
@media (max-width: 1180px) {
  .dashboard-metrics-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .realtime-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ms-header-context span {
    display: none;
  }
}

@media (max-width: 900px) {
  .login-container {
    padding: 82px 20px 66px;
  }

  .login-brand-corner {
    top: 22px;
    left: 22px;
  }

  .el-header.ms-header {
    height: 58px;
    padding: 0 10px !important;
  }

  .sidebar-toggle,
  .ms-header-divider,
  .ms-header-context,
  .header-brand-copy span {
    display: none;
  }

  .ms-header-actions {
    gap: 6px;
  }

  .engine-state,
  .role-badge {
    min-height: 30px;
    padding: 0 8px;
  }

  .app-layout-root {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }


  .app-layout-body {
    height: auto;
    min-height: calc(100vh - 58px);
  }

  .app-layout-body > .el-aside {
    width: 100% !important;
  }

  .app-sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--ms-border);
  }

  .sidebar-section-label {
    display: none;
  }

  .app-sidebar .el-menu {
    display: flex;
    gap: 2px;
    padding: 5px 8px;
    overflow-x: auto;
  }

  .app-sidebar .el-menu-item {
    flex: 0 0 auto;
    height: 40px;
    margin: 0;
    padding: 0 12px !important;
  }

  .el-main.ms-main {
    width: 100%;
    height: auto;
    min-height: calc(100vh - 108px);
    padding: 14px 12px 28px;
  }

  .workspace-heading {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .workspace-heading h1 {
    font-size: 19px;
  }

  .workspace-heading p {
    font-size: 11px;
  }

  .dashboard-metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-metrics-row.is-guest {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 96px;
    padding: 13px;
  }

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

  .resource-toolbar {
    top: -14px;
  }

  .config-save-bar {
    bottom: -28px;
    margin-right: -12px;
    margin-left: -12px;
    padding: 11px 12px;
  }

  .config-save-copy span {
    display: none;
  }
}

@media (max-width: 560px) {
  .login-container {
    align-items: flex-start;
    padding: 76px 16px 58px;
  }

  .login-brand-corner {
    left: 16px;
  }

  .login-box {
    padding: 28px 22px 24px;
  }

  .login-heading h1 {
    font-size: 22px;
  }

  .header-brand-mark {
    width: 32px;
    height: 32px;
  }

  .header-brand-copy {
    display: none;
  }

  .engine-state span {
    display: none;
  }

  .role-badge {
    display: none;
  }

  .workspace-heading p {
    max-width: 100%;
  }

  .dashboard-metrics-row,
  .dashboard-metrics-row.is-guest {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-value {
    font-size: 18px;
  }

  .realtime-grid {
    gap: 8px;
  }

  .realtime-card {
    min-height: 132px;
    padding: 12px;
  }

  .realtime-big {
    font-size: 22px;
  }

  .config-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .config-save-bar .el-button {
    width: 100%;
  }

  .task-export-row {
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.realtime-status-bar > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.realtime-status-bar > div:first-child h2 {
  display: none;
}

.realtime-status-bar > div:first-child > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ms-text-soft) !important;
  font-size: 12px !important;
}

.realtime-status-bar > div:first-child > div::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ms-success);
  box-shadow: 0 0 0 4px var(--ms-success-soft);
}

.config-save-bar > .el-button {
  width: auto !important;
  margin-top: 0 !important;
}

@media (max-width: 560px) {
  .config-save-bar > .el-button {
    width: 100% !important;
  }
}

.sidebar-toggle-glyph {
  display: block;
  position: relative;
  width: 16px;
  height: 16px;
  color: currentColor;
}

.sidebar-toggle-glyph::before {
  content: "\2039";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 16px;
}

.sidebar-toggle-glyph.is-collapsed::before {
  content: "\203A";
}
