:root {
  --ops-bg: #0b1220;
  --ops-surface: #111827;
  --ops-surface-2: #1a2332;
  --ops-border: rgba(148, 163, 184, 0.14);
  --ops-text: #e2e8f0;
  --ops-muted: #94a3b8;
  --ops-accent: #38bdf8;
  --ops-accent-dim: rgba(56, 189, 248, 0.12);
  --ops-success: #34d399;
  --ops-warning: #fbbf24;
  --ops-danger: #f87171;
  --ops-radius: 12px;
  --ops-sidebar-w: 260px;
  --ops-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

a { color: var(--ops-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App shell ── */
.ops-app {
  display: flex;
  min-height: 100vh;
}

.ops-sidebar {
  width: var(--ops-sidebar-w);
  flex-shrink: 0;
  background: var(--ops-surface);
  border-right: 1px solid var(--ops-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.ops-sidebar__brand {
  padding: 20px 18px 12px;
  border-bottom: 1px solid var(--ops-border);
}

.ops-sidebar__logo img {
  display: block;
  max-width: 150px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.ops-sidebar__badge {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ops-accent);
  background: var(--ops-accent-dim);
  border-radius: 999px;
}

.ops-sidebar__nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ops-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ops-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.ops-sidebar__link:hover {
  background: var(--ops-surface-2);
  color: var(--ops-text);
  text-decoration: none;
}

.ops-sidebar__link.is-active {
  background: var(--ops-accent-dim);
  color: var(--ops-accent);
}

.ops-sidebar__icon {
  width: 22px;
  text-align: center;
  font-size: 15px;
}

.ops-sidebar__footer {
  padding: 14px 10px 18px;
  border-top: 1px solid var(--ops-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ops-sidebar__link--muted {
  font-size: 13px;
  padding: 8px 12px;
}

.ops-user-chip {
  padding: 10px 12px 12px;
  margin-bottom: 4px;
}

.ops-user-chip__email {
  display: block;
  font-size: 13px;
  color: var(--ops-text);
  word-break: break-all;
}

.ops-user-chip__role {
  display: block;
  font-size: 11px;
  color: var(--ops-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.ops-app__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ops-topbar {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--ops-surface);
  border-bottom: 1px solid var(--ops-border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.ops-topbar__title {
  font-weight: 600;
  font-size: 15px;
}

.ops-topbar__menu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--ops-border);
  border-radius: 8px;
  background: var(--ops-surface-2);
  cursor: pointer;
}

.ops-topbar__menu span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--ops-text);
  border-radius: 1px;
}

.ops-main {
  flex: 1;
  padding: 28px 32px 48px;
  max-width: 1200px;
  width: 100%;
}

/* ── Auth shell ── */
.ops-body--auth {
  background: radial-gradient(ellipse at 30% 0%, rgba(56, 189, 248, 0.08), transparent 55%), var(--ops-bg);
}

.ops-auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ops-auth-shell__back {
  position: absolute;
  top: 20px;
  left: 24px;
  font-size: 14px;
  color: var(--ops-muted);
}

.ops-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.ops-auth-card__logo {
  display: block;
  margin: 0 auto 8px;
  max-width: min(150px, 70%);
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.ops-auth-card__tag {
  text-align: center;
  color: var(--ops-muted);
  font-size: 13px;
  margin: 0 0 24px;
}

.ops-auth-card h1 {
  margin: 0 0 20px;
  font-size: 22px;
  text-align: center;
}

/* ── Page header ── */
.ops-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.ops-page-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ops-page-header__text .ops-muted {
  margin: 6px 0 0;
  font-size: 15px;
}

.ops-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── Stats ── */
.ops-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.ops-stat {
  padding: 18px 20px;
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
}

.ops-stat__value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ops-text);
}

.ops-stat__label {
  font-size: 13px;
  color: var(--ops-muted);
  margin-top: 4px;
}

.ops-stat--warn .ops-stat__value { color: var(--ops-warning); }

/* ── Module grid ── */
.ops-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.ops-module-card {
  display: block;
  padding: 22px;
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.ops-module-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  text-decoration: none;
}

.ops-module-card__icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.ops-module-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.ops-module-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ops-muted);
  line-height: 1.45;
}

.ops-module-card__meta {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ops-accent);
  font-weight: 500;
}

/* ── Quick actions ── */
.ops-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

/* ── Cards & panels ── */
.ops-panel {
  padding: 22px;
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  margin-bottom: 20px;
}

.ops-panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

/* ── Tables ── */
.ops-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  background: var(--ops-surface);
}

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

.ops-table th,
.ops-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--ops-border);
}

.ops-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ops-muted);
  background: var(--ops-surface-2);
}

.ops-table tbody tr:last-child td { border-bottom: none; }

.ops-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

.ops-table .ops-actions {
  text-align: right;
  white-space: nowrap;
}

/* ── Forms ── */
.ops-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
}

.ops-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ops-field span {
  font-size: 13px;
  font-weight: 500;
  color: var(--ops-muted);
}

.ops-field input,
.ops-field select,
.ops-field textarea {
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ops-text);
  background: var(--ops-surface-2);
  border: 1px solid var(--ops-border);
  border-radius: 8px;
}

.ops-field input:focus,
.ops-field select:focus,
.ops-field textarea:focus {
  outline: none;
  border-color: var(--ops-accent);
  box-shadow: 0 0 0 3px var(--ops-accent-dim);
}

.ops-field textarea { min-height: 100px; resize: vertical; }

.ops-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Buttons ── */
.ops-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #0b1220;
  background: var(--ops-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s;
}

.ops-button:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.ops-button--ghost {
  color: var(--ops-text);
  background: transparent;
  border: 1px solid var(--ops-border);
}

.ops-button--ghost:hover { background: var(--ops-surface-2); }

.ops-button--danger {
  color: #fff;
  background: #dc2626;
}

.ops-link-btn {
  font-size: 14px;
  font-weight: 500;
}

/* ── Badges ── */
.ops-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ops-badge--ok { background: rgba(52, 211, 153, 0.15); color: var(--ops-success); }
.ops-badge--warn { background: rgba(251, 191, 36, 0.15); color: var(--ops-warning); }
.ops-badge--muted { background: rgba(148, 163, 184, 0.12); color: var(--ops-muted); }
.ops-badge--info { background: var(--ops-accent-dim); color: var(--ops-accent); }

/* ── Empty state ── */
.ops-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--ops-surface);
  border: 1px dashed var(--ops-border);
  border-radius: var(--ops-radius);
}

.ops-empty__icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.ops-empty h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.ops-empty p {
  margin: 0 0 20px;
  color: var(--ops-muted);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Flash ── */
.ops-flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.ops-flash--error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.ops-flash--success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

/* ── Misc ── */
.ops-muted { color: var(--ops-muted); }

.ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.ops-toolbar h1 { margin: 0; font-size: 26px; }

.ops-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.ops-detail-item label {
  display: block;
  font-size: 12px;
  color: var(--ops-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.ops-detail-item div {
  font-size: 15px;
}

.ops-section-title {
  margin: 28px 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ops-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Mobile ── */
@media (max-width: 900px) {
  .ops-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

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

  .ops-topbar { display: flex; }

  .ops-main { padding: 20px 16px 40px; }

  .ops-field-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .ops-page-header { flex-direction: column; }
  .ops-page-header__actions { width: 100%; }
  .ops-page-header__actions .ops-button { flex: 1; }
}

.ops-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

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

@media (max-width: 900px) {
  .ops-grid--2 { grid-template-columns: 1fr; }
}

.ops-alert {
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid var(--ops-border);
  margin-bottom: 20px;
  background: var(--ops-surface-2);
}

.ops-alert--success { border-color: rgba(74, 222, 128, 0.35); }
.ops-alert--warn { color: var(--ops-warning); border-color: rgba(251, 191, 36, 0.35); }

.ops-field--check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.ops-field--check input { width: auto; accent-color: var(--ops-accent); }
