:root {
  --cy-bg: #0b1020;
  --cy-bg-2: #111733;
  --cy-surface: #161d3a;
  --cy-surface-2: #1c2547;
  --cy-border: #243056;
  --cy-text: #e7ecff;
  --cy-text-muted: #8f9bc5;
  --cy-primary: #5b6cff;
  --cy-primary-hover: #7484ff;
  --cy-accent: #22d3ee;
  --cy-success: #22c55e;
  --cy-warning: #f59e0b;
  --cy-danger: #ef4444;
}

html, body {
  background: radial-gradient(circle at 0% 0%, #1b1f4a 0%, var(--cy-bg) 60%) fixed;
  color: var(--cy-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

a { color: var(--cy-primary); text-decoration: none; }
a:hover { color: var(--cy-primary-hover); }

.cy-shell { display: flex; min-height: 100vh; }
.cy-sidebar {
  width: 250px;
  background: linear-gradient(180deg, #0f1530 0%, #0a0f24 100%);
  border-right: 1px solid var(--cy-border);
  padding: 1.25rem 1rem;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.cy-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; }
.cy-brand .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--cy-success);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.15);
}
.cy-nav { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cy-nav .nav-section {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--cy-text-muted); padding: 0.75rem 0.75rem 0.4rem;
}
.cy-nav a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.75rem; border-radius: 8px;
  color: var(--cy-text-muted); font-size: 0.92rem;
  cursor: pointer;
}
.cy-nav a:hover { background: rgba(255,255,255,0.04); color: var(--cy-text); }
.cy-nav a.active {
  background: linear-gradient(90deg, rgba(91,108,255,0.25), rgba(91,108,255,0));
  color: #fff; position: relative;
}
.cy-nav a.active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--cy-primary); border-radius: 3px;
}

.cy-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cy-topbar {
  height: 64px;
  background: rgba(11,16,32,0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cy-border);
  display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem;
  position: sticky; top: 0; z-index: 10;
}
.cy-content { padding: 1.5rem 2rem 4rem; }
.cy-page-title { font-size: 1.5rem; font-weight: 700; }
.cy-page-subtitle { color: var(--cy-text-muted); font-size: 0.95rem; margin-bottom: 1.25rem; }

.cy-card {
  background: var(--cy-surface);
  border: 1px solid var(--cy-border);
  border-radius: 14px;
}
.cy-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--cy-border);
  padding: 0.9rem 1.1rem; font-weight: 600;
  display: flex; align-items: center; gap: 0.5rem;
}
.cy-card .card-body { padding: 1.1rem; }

.cy-stat {
  background: var(--cy-surface);
  border: 1px solid var(--cy-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: 1rem;
}
.cy-stat .icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; background: rgba(91,108,255,0.15); color: var(--cy-primary);
}
.cy-stat.success .icon { background: rgba(34,197,94,.15); color: var(--cy-success); }
.cy-stat.warning .icon { background: rgba(245,158,11,.15); color: var(--cy-warning); }
.cy-stat.danger  .icon { background: rgba(239,68,68,.15); color: var(--cy-danger); }
.cy-stat.info    .icon { background: rgba(34,211,238,.15); color: var(--cy-accent); }
.cy-stat .label { color: var(--cy-text-muted); font-size: 0.82rem; }
.cy-stat .value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }

.form-control, .form-select, .input-group-text {
  background: var(--cy-surface-2);
  border: 1px solid var(--cy-border);
  color: var(--cy-text);
}
.form-control:focus, .form-select:focus {
  background: var(--cy-surface-2);
  border-color: var(--cy-primary); color: var(--cy-text);
  box-shadow: 0 0 0 0.2rem rgba(91,108,255,0.2);
}
.form-control::placeholder { color: #6b75a0; }
.form-label { font-size: 0.82rem; color: var(--cy-text-muted); margin-bottom: 0.3rem; }

.btn-primary { background: var(--cy-primary); border-color: var(--cy-primary); }
.btn-primary:hover, .btn-primary:focus {
  background: var(--cy-primary-hover); border-color: var(--cy-primary-hover);
}
.btn-soft {
  background: rgba(255,255,255,0.05); border: 1px solid var(--cy-border); color: var(--cy-text);
}
.btn-soft:hover { background: rgba(255,255,255,0.1); color: var(--cy-text); }
.btn-soft-danger {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.35); color: #fca5a5;
}
.btn-soft-danger:hover { background: rgba(239,68,68,0.2); color: #fff; }

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--cy-text);
  --bs-table-border-color: var(--cy-border);
  --bs-table-hover-bg: rgba(255,255,255,0.04);
  --bs-table-hover-color: var(--cy-text);
}
.table thead th {
  color: var(--cy-text-muted); font-weight: 600; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom-color: var(--cy-border);
}

.cy-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; padding: 0.25rem 0.55rem;
  border-radius: 999px; font-weight: 600;
}
.cy-badge.online  { background: rgba(34,197,94,.15); color: #4ade80; }
.cy-badge.offline { background: rgba(148,163,184,.15); color: #94a3b8; }
.cy-badge.live    { background: rgba(239,68,68,.15); color: #f87171; }
.cy-badge.live .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #f87171;
  box-shadow: 0 0 0 4px rgba(239,68,68,.2); animation: pulse 2s infinite;
}
.cy-badge.revoked { background: rgba(239,68,68,.18); color: #fca5a5; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  70%  { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.text-muted-2 { color: var(--cy-text-muted) !important; }
.font-mono { font-family: "JetBrains Mono", "Fira Code", Menlo, monospace; font-size: 0.85rem; }
.bg-soft { background: rgba(255,255,255,0.03); }

.cy-auth {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background:
    radial-gradient(800px 400px at 80% 0%, rgba(91,108,255,0.18), transparent 60%),
    radial-gradient(700px 400px at 10% 100%, rgba(34,211,238,0.14), transparent 60%),
    var(--cy-bg);
}

.cy-empty { text-align: center; padding: 2.5rem 1rem; color: var(--cy-text-muted); }
.cy-empty i { font-size: 2.3rem; color: var(--cy-primary); opacity: 0.55; display: block; margin-bottom: 0.5rem; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

.copy-row { display: flex; align-items: center; gap: 0.5rem; }
.copy-row code {
  background: var(--cy-surface-2); padding: 0.4rem 0.65rem; border-radius: 8px;
  font-family: "JetBrains Mono", Menlo, monospace; color: var(--cy-accent);
  flex: 1; overflow: auto;
}
