:root {
  color-scheme: dark;
  --ops-bg: #080d14;
  --ops-bg-2: #0b121c;
  --ops-surface: #111a26;
  --ops-surface-2: #162130;
  --ops-surface-3: #1c2939;
  --ops-line: #273447;
  --ops-line-soft: rgba(153, 174, 201, .14);
  --ops-text: #f5f8fc;
  --ops-muted: #91a0b5;
  --ops-subtle: #6f7e92;
  --ops-yellow: #ffd400;
  --ops-yellow-ink: #171300;
  --ops-cyan: #28bff2;
  --ops-green: #55d67b;
  --ops-amber: #ffad32;
  --ops-red: #ff595e;
  --ops-blue: #5c8dff;
  --ops-radius-sm: 9px;
  --ops-radius: 14px;
  --ops-radius-lg: 18px;
  --ops-shadow: 0 20px 60px rgba(0, 0, 0, .28);
  --ops-font: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  --ops-display: "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --ops-bg: #eef1f4;
  --ops-bg-2: #f7f8f9;
  --ops-surface: #ffffff;
  --ops-surface-2: #f1f3f5;
  --ops-surface-3: #e6eaed;
  --ops-line: #cbd2d8;
  --ops-line-soft: rgba(45, 58, 70, .14);
  --ops-text: #1d252c;
  --ops-muted: #66727d;
  --ops-subtle: #89939c;
  --ops-yellow: #e1b900;
  --ops-yellow-ink: #211b00;
  --ops-cyan: #008fbe;
  --ops-green: #18884b;
  --ops-amber: #c37700;
  --ops-red: #d33d48;
  --ops-blue: #366dd8;
  --ops-shadow: 0 18px 48px rgba(27, 38, 48, .14);
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ops-bg);
  color: var(--ops-text);
  font-family: var(--ops-font);
  -webkit-font-smoothing: antialiased;
}

html[data-theme="light"] .ops-btn:hover,
html[data-theme="light"] .ops-icon-btn:hover { border-color: #aeb8c0; }

html[data-theme="light"] .ops-modal,
html[data-theme="light"] .ops-drawer,
html[data-theme="light"] .ops-auth { --ops-overlay: rgba(50, 59, 68, .42); }

.theme-toggle { min-width: 118px; }
.theme-toggle .ops-icon { width: 18px; height: 18px; }

body { min-height: 100dvh; }

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button { cursor: pointer; }

button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

a { color: inherit; }

.ops-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ops-btn,
.ops-icon-btn {
  border: 1px solid var(--ops-line);
  background: var(--ops-surface-2);
  color: var(--ops-text);
  min-height: 42px;
  border-radius: var(--ops-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 750;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.ops-btn { padding: 0 16px; }

.ops-icon-btn {
  width: 42px;
  padding: 0;
}

.ops-btn:hover,
.ops-icon-btn:hover {
  border-color: #43546b;
  background: var(--ops-surface-3);
}

.ops-btn:active,
.ops-icon-btn:active { transform: translateY(1px); }

.ops-btn.primary {
  border-color: var(--ops-yellow);
  background: var(--ops-yellow);
  color: var(--ops-yellow-ink);
}

.ops-btn.danger {
  border-color: rgba(255, 89, 94, .5);
  background: rgba(255, 89, 94, .12);
  color: #ff8d91;
}

.ops-btn.ghost { background: transparent; }

.ops-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.ops-field > span,
.ops-label {
  color: var(--ops-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .035em;
}

.ops-input,
.ops-select,
.ops-textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--ops-line);
  border-radius: var(--ops-radius-sm);
  background: var(--ops-bg-2);
  color: var(--ops-text);
  padding: 0 12px;
  outline: none;
}

.ops-textarea {
  min-height: 96px;
  padding-block: 10px;
  resize: vertical;
}

.ops-input:focus,
.ops-select:focus,
.ops-textarea:focus {
  border-color: var(--ops-cyan);
  box-shadow: 0 0 0 3px rgba(40, 191, 242, .12);
}

.ops-panel {
  border: 1px solid var(--ops-line-soft);
  border-radius: var(--ops-radius);
  background: var(--ops-surface);
}

.ops-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ops-section-head h2,
.ops-section-head h3,
.ops-section-head p { margin: 0; }

.ops-section-head h2 {
  font-family: var(--ops-display);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.ops-section-head h3 { font-size: 16px; }

.ops-section-head p {
  margin-top: 5px;
  color: var(--ops-muted);
  font-size: 13px;
  line-height: 1.45;
}

.ops-kicker {
  color: var(--ops-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.ops-pill,
.ops-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--ops-line);
  background: var(--ops-surface-2);
  color: var(--ops-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ops-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 15%, transparent);
}

.ops-status.green { color: var(--ops-green); }
.ops-status.amber { color: var(--ops-amber); }
.ops-status.red { color: var(--ops-red); }
.ops-status.cyan { color: var(--ops-cyan); }

.ops-metric {
  min-width: 0;
  padding: 14px 15px;
  border-right: 1px solid var(--ops-line-soft);
}

.ops-metric:last-child { border-right: 0; }

.ops-metric-label {
  color: var(--ops-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-metric-value {
  margin-top: 7px;
  font-family: var(--ops-display);
  font-size: 27px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -.035em;
}

.ops-metric-note {
  margin-top: 5px;
  color: var(--ops-subtle);
  font-size: 11px;
}

.ops-table-wrap {
  min-width: 0;
  overflow: auto;
  scrollbar-width: thin;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ops-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--ops-surface);
  color: var(--ops-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .045em;
  text-align: left;
  white-space: nowrap;
}

.ops-table th,
.ops-table td {
  min-height: 44px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--ops-line-soft);
  vertical-align: middle;
}

.ops-table tbody tr {
  transition: background .15s ease;
}

.ops-table tbody tr:hover,
.ops-table tbody tr.selected { background: rgba(255, 212, 0, .055); }

.ops-table tbody tr.selected { box-shadow: inset 3px 0 var(--ops-yellow); }

.ops-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--ops-muted);
  text-align: center;
  line-height: 1.5;
}

.ops-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ops-surface-3);
}

.ops-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ops-green);
}

.ops-divider {
  height: 1px;
  background: var(--ops-line-soft);
}

.ops-modal,
.ops-drawer,
.ops-auth {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.ops-modal.visible,
.ops-drawer.visible,
.ops-auth.visible { display: grid; }

.ops-modal,
.ops-auth {
  place-items: center;
  padding: 18px;
  background: rgba(2, 5, 9, .78);
  backdrop-filter: blur(12px);
}

.ops-modal-card,
.ops-auth-card {
  width: min(620px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  border: 1px solid var(--ops-line);
  border-radius: var(--ops-radius-lg);
  background: var(--ops-surface);
  box-shadow: var(--ops-shadow);
}

.ops-auth-card { width: min(430px, 100%); }

.ops-modal-head,
.ops-modal-body,
.ops-auth-card { padding: 20px; }

.ops-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--ops-line-soft);
}

.ops-modal-head h2 { margin: 0; font-size: 20px; }

.ops-drawer {
  grid-template-columns: 1fr minmax(320px, 430px);
  background: rgba(2, 5, 9, .58);
}

.ops-drawer-card {
  grid-column: 2;
  height: 100dvh;
  overflow: auto;
  border-left: 1px solid var(--ops-line);
  background: var(--ops-surface);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .32);
}

.ops-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ops-form-grid .wide { grid-column: 1 / -1; }

.ops-toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 140;
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.ops-toast {
  min-width: min(340px, calc(100vw - 36px));
  padding: 13px 15px;
  border: 1px solid var(--ops-line);
  border-radius: var(--ops-radius-sm);
  background: var(--ops-surface-2);
  color: var(--ops-text);
  box-shadow: var(--ops-shadow);
  font-size: 13px;
  animation: ops-toast-in .2s ease both;
}

.ops-toast.error { border-color: rgba(255, 89, 94, .55); }
.ops-toast.success { border-color: rgba(85, 214, 123, .55); }

@keyframes ops-toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.ops-skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--ops-surface-2), var(--ops-surface-3), var(--ops-surface-2));
  background-size: 240% 100%;
  animation: ops-shimmer 1.4s linear infinite;
}

@keyframes ops-shimmer { to { background-position: -240% 0; } }

.ops-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 720px) {
  .ops-btn { min-height: 46px; }
  .ops-icon-btn { width: 46px; min-height: 46px; }
  .ops-form-grid { grid-template-columns: 1fr; }
  .ops-form-grid .wide { grid-column: auto; }
  .ops-modal,
  .ops-auth { padding: 10px; align-items: end; }
  .ops-modal-card,
  .ops-auth-card { max-height: calc(100dvh - 20px); border-radius: 18px; }
  .ops-drawer { grid-template-columns: 1fr; align-items: end; }
  .ops-drawer-card {
    grid-column: 1;
    height: min(78dvh, 720px);
    border: 1px solid var(--ops-line);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
  }
  .ops-toast-host { left: 12px; right: 12px; bottom: 86px; }
  .ops-toast { min-width: 0; }
}

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