:root {
  --ops-bg: #0b0b0a;
  --ops-panel: #121210;
  --ops-panel-2: #181714;
  --ops-line: #2c2923;
  --ops-line-strong: #494238;
  --ops-text: #f2eee5;
  --ops-muted: #a8a095;
  --ops-gold: #e0a83c;
  --ops-green: #57b883;
  --ops-coral: #dc795e;
  --ops-blue: #6aa6c8;
  --ops-sidebar: 228px;
}

* { box-sizing: border-box; }

html { background: var(--ops-bg); color-scheme: dark; }

body.ops-body {
  margin: 0;
  background: var(--ops-bg);
  color: var(--ops-text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

.ops-skip {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 10px 14px;
  background: var(--ops-text);
  color: #111;
  border-radius: 4px;
}

.ops-skip:focus { transform: translateY(0); }

.ops-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 22px;
  border-bottom: 1px solid var(--ops-line);
  background: rgba(11, 11, 10, .96);
  backdrop-filter: blur(16px);
}

.ops-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ops-text);
  text-decoration: none;
}

.ops-brand img { width: 34px; height: 34px; border-radius: 6px; }
.ops-brand strong { display: block; font-family: "Cinzel", Georgia, serif; font-size: .86rem; }
.ops-brand span { display: block; margin-top: 2px; color: var(--ops-muted); font-size: .68rem; }

.ops-top-actions { display: flex; align-items: center; gap: 8px; }

.ops-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: var(--ops-sidebar) minmax(0, 1fr);
}

.ops-sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  padding: 22px 14px;
  border-right: 1px solid var(--ops-line);
  background: #0e0e0c;
}

.ops-sidebar-label,
.ops-eyebrow,
.ops-table th,
.ops-field > span,
.ops-kpi-label {
  font-family: "Share Tech Mono", Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ops-sidebar-label {
  margin: 0 10px 12px;
  color: #706a61;
  font-size: .62rem;
}

.ops-nav { display: grid; gap: 4px; }

.ops-nav-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ops-muted);
  text-align: left;
  cursor: pointer;
}

.ops-nav-btn:hover { color: var(--ops-text); background: var(--ops-panel); }
.ops-nav-btn[aria-current="page"] {
  color: var(--ops-text);
  border-color: #463d2d;
  background: #1a1711;
}

.ops-nav-mark {
  width: 22px;
  color: var(--ops-gold);
  font-family: "Share Tech Mono", Consolas, monospace;
  font-size: .7rem;
  text-align: center;
}

.ops-connection {
  position: absolute;
  right: 14px;
  bottom: 20px;
  left: 14px;
  padding: 12px;
  border: 1px solid var(--ops-line);
  border-radius: 6px;
  background: var(--ops-panel);
}

.ops-connection strong { display: block; font-size: .76rem; }
.ops-connection p { margin: 4px 0 0; color: var(--ops-muted); font-size: .72rem; line-height: 1.45; }

.ops-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ops-muted); }
.ops-dot.local { background: var(--ops-gold); }
.ops-dot.cloud { background: var(--ops-green); }
.ops-dot.error { background: var(--ops-coral); }

.ops-main { min-width: 0; padding: 28px clamp(18px, 3vw, 42px) 72px; }

.ops-pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.ops-eyebrow { margin: 0 0 7px; color: var(--ops-gold); font-size: .65rem; }
.ops-pagehead h1 { margin: 0; font-family: "Cinzel", Georgia, serif; font-size: clamp(1.45rem, 2.4vw, 2.2rem); font-weight: 500; }
.ops-pagehead p { max-width: 650px; margin: 7px 0 0; color: var(--ops-muted); font-size: .88rem; line-height: 1.6; }
.ops-page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.ops-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--ops-line-strong);
  border-radius: 5px;
  background: var(--ops-panel);
  color: var(--ops-text);
  text-decoration: none;
  cursor: pointer;
}

.ops-btn:hover { border-color: var(--ops-gold); }
.ops-btn.primary { border-color: var(--ops-gold); background: var(--ops-gold); color: #171207; font-weight: 750; }
.ops-btn.danger { border-color: #694137; color: #f0a08a; }
.ops-btn.compact { min-height: 32px; padding: 6px 10px; font-size: .76rem; }
.ops-btn:disabled { opacity: .5; cursor: not-allowed; }

.ops-auth,
.ops-notice {
  margin-bottom: 20px;
  padding: 15px 17px;
  border: 1px solid #51462f;
  border-radius: 6px;
  background: #17140e;
}

.ops-auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 440px); align-items: center; gap: 22px; }
.ops-auth h2 { margin: 0 0 5px; font-size: 1rem; }
.ops-auth p, .ops-notice { color: var(--ops-muted); font-size: .82rem; line-height: 1.55; }
.ops-auth-form { display: flex; gap: 8px; }
.ops-auth-form input { min-width: 0; flex: 1; }
.ops-notice.error { border-color: #643d34; background: #1c110e; color: #efab98; }
.ops-notice.success { border-color: #315b43; background: #0f1913; color: #9edbb8; }

.ops-view[hidden], .ops-hidden { display: none !important; }

.ops-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.ops-kpi {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--ops-line);
  border-radius: 6px;
  background: var(--ops-panel);
}

.ops-kpi-label { color: var(--ops-muted); font-size: .61rem; }
.ops-kpi-value { display: block; margin-top: 13px; font-family: "Cinzel", Georgia, serif; font-size: 1.65rem; font-variant-numeric: tabular-nums; }
.ops-kpi-meta { display: block; margin-top: 5px; color: var(--ops-muted); font-size: .72rem; }

.ops-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 14px; }
.ops-stack { display: grid; align-content: start; gap: 14px; }

.ops-panel {
  min-width: 0;
  border: 1px solid var(--ops-line);
  border-radius: 6px;
  background: var(--ops-panel);
}

.ops-panel-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--ops-line);
}

.ops-panel-head h2 { margin: 0; font-size: .9rem; }
.ops-panel-head p { margin: 4px 0 0; color: var(--ops-muted); font-size: .72rem; }
.ops-panel-body { padding: 15px; }

.ops-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ops-toolbar .ops-input { width: min(300px, 100%); }

.ops-input,
.ops-select,
.ops-textarea {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--ops-line-strong);
  border-radius: 4px;
  outline: 0;
  background: #0e0e0c;
  color: var(--ops-text);
}

.ops-input:focus,
.ops-select:focus,
.ops-textarea:focus { border-color: var(--ops-gold); box-shadow: 0 0 0 2px rgba(224, 168, 60, .15); }
.ops-textarea { min-height: 84px; resize: vertical; }

.ops-field { display: grid; gap: 6px; }
.ops-field > span { color: var(--ops-muted); font-size: .58rem; }
.ops-form { display: grid; gap: 12px; }
.ops-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ops-check { display: flex; align-items: center; gap: 8px; color: var(--ops-muted); font-size: .8rem; }
.ops-check input { width: 17px; height: 17px; accent-color: var(--ops-gold); }

.ops-table-wrap { width: 100%; overflow: auto; }
.ops-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.ops-table th { padding: 10px 12px; border-bottom: 1px solid var(--ops-line); color: #8d857a; font-size: .56rem; text-align: left; white-space: nowrap; }
.ops-table td { padding: 11px 12px; border-bottom: 1px solid #211f1b; color: var(--ops-muted); vertical-align: middle; }
.ops-table tbody tr:last-child td { border-bottom: 0; }
.ops-table tbody tr:hover { background: rgba(255,255,255,.018); }
.ops-table strong { color: var(--ops-text); font-weight: 650; }
.ops-table code { color: var(--ops-gold); font-size: .7rem; }
.ops-table .ops-input, .ops-table .ops-select { min-height: 32px; min-width: 112px; padding: 5px 7px; font-size: .73rem; }
.ops-table .ops-wide-input { min-width: 210px; }

.ops-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--ops-line-strong);
  border-radius: 999px;
  color: var(--ops-muted);
  font-size: .68rem;
  white-space: nowrap;
}

.ops-status.verified,
.ops-status.active,
.ops-status.paid,
.ops-status.complete { border-color: #315b43; background: #101b14; color: #8fd0aa; }
.ops-status.pilot,
.ops-status.qualified,
.ops-status.building { border-color: #62512d; background: #1c170d; color: #e7bc61; }
.ops-status.failed,
.ops-status.lost,
.ops-status.blocked { border-color: #653b32; background: #1d100d; color: #eb9178; }

.ops-progress { width: 118px; height: 6px; overflow: hidden; border-radius: 99px; background: #292620; }
.ops-progress > span { display: block; height: 100%; background: var(--ops-green); }

.ops-pipeline-bars { display: grid; gap: 12px; }
.ops-pipeline-row { display: grid; grid-template-columns: 82px minmax(80px, 1fr) 28px; align-items: center; gap: 10px; font-size: .74rem; }
.ops-pipeline-row > span:first-child { color: var(--ops-muted); }
.ops-bar { height: 7px; overflow: hidden; border-radius: 999px; background: #292620; }
.ops-bar i { display: block; height: 100%; background: var(--ops-gold); }
.ops-pipeline-row b { color: var(--ops-text); text-align: right; }

.ops-empty { padding: 30px 16px !important; color: #7e776d !important; text-align: center; }

.ops-dialog {
  width: min(560px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--ops-line-strong);
  border-radius: 7px;
  background: var(--ops-panel);
  color: var(--ops-text);
}

.ops-dialog::backdrop { background: rgba(0, 0, 0, .76); backdrop-filter: blur(4px); }
.ops-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--ops-line); }
.ops-dialog-head h2 { margin: 0; font-size: .95rem; }
.ops-dialog-body { padding: 16px; }
.ops-icon-btn { width: 34px; height: 34px; padding: 0; border: 1px solid var(--ops-line); border-radius: 4px; background: transparent; color: var(--ops-muted); cursor: pointer; }
.ops-icon-btn:hover { color: var(--ops-text); border-color: var(--ops-gold); }

.ops-toast {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  max-width: min(390px, calc(100vw - 40px));
  padding: 12px 15px;
  border: 1px solid var(--ops-line-strong);
  border-radius: 5px;
  background: #191814;
  color: var(--ops-text);
  font-size: .8rem;
  box-shadow: 0 16px 46px rgba(0,0,0,.35);
}

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

@media (max-width: 760px) {
  .ops-topbar { height: 58px; padding: 0 14px; }
  .ops-brand span { display: none; }
  .ops-shell { display: block; min-height: calc(100vh - 58px); }
  .ops-sidebar { position: sticky; z-index: 20; top: 58px; width: 100%; height: auto; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--ops-line); }
  .ops-sidebar-label, .ops-connection { display: none; }
  .ops-nav { display: flex; width: max-content; }
  .ops-nav-btn { width: auto; min-height: 38px; white-space: nowrap; }
  .ops-main { padding: 22px 14px 64px; }
  .ops-pagehead { display: block; }
  .ops-page-actions { justify-content: flex-start; margin-top: 15px; }
  .ops-auth { grid-template-columns: 1fr; }
  .ops-form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .ops-top-actions .ops-btn:first-child { display: none; }
  .ops-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ops-kpi { min-height: 98px; padding: 13px; }
  .ops-kpi-value { font-size: 1.35rem; }
  .ops-auth-form { display: grid; }
  .ops-panel-head { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
