:root {
  --bg: #070912;
  --bg-2: #0c1020;
  --panel: rgba(20, 25, 45, 0.62);
  --panel-solid: #121730;
  --panel-hi: rgba(36, 44, 76, 0.7);
  --line: rgba(148, 163, 255, 0.12);
  --line-hi: rgba(148, 163, 255, 0.28);
  --text: #e8ebff;
  --muted: #8b93b8;
  --dim: #5b6388;
  --cyan: #38bdf8;
  --violet: #a855f7;
  --pink: #ec4899;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(135deg, var(--cyan), var(--violet) 60%, var(--pink));
  --radius: 16px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar: 248px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
a { color: var(--cyan); text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: rgba(168, 85, 247, 0.4); }

/* ---------- animated background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; contain: strict; }
.blob {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  opacity: 0.55; will-change: transform;
  animation: drift 26s var(--ease) infinite alternate;
}
.b1 { background: radial-gradient(circle, rgba(29, 78, 216, 0.9), transparent 65%); top: -18vmax; left: -10vmax; }
.b2 { background: radial-gradient(circle, rgba(124, 58, 237, 0.85), transparent 65%); bottom: -22vmax; right: -12vmax; animation-duration: 32s; animation-delay: -8s; }
.b3 { background: radial-gradient(circle, rgba(219, 39, 119, 0.7), transparent 65%); top: 30%; left: 45%; width: 30vmax; height: 30vmax; opacity: 0.3; animation-duration: 38s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(8vmax, 6vmax) scale(1.15) rotate(30deg); }
  100% { transform: translate(-6vmax, 10vmax) scale(0.9) rotate(-20deg); }
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 10%, transparent 70%);
  opacity: 0.45;
}
#app { position: relative; z-index: 1; min-height: 100vh; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); padding: 40px 36px 32px; border-radius: 24px;
  background: var(--panel); backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--shadow); position: relative;
  animation: rise 0.8s var(--ease) both;
}
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 60%, var(--cyan), var(--violet), var(--pink), transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite;
}
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --angle: 360deg; } }
.login-card.shake { animation: shake 0.45s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); }
}
.login-card h1 { font-size: 26px; margin: 18px 0 4px; letter-spacing: -0.02em; }
.login-card p.sub { color: var(--muted); margin: 0 0 28px; }
.login-foot { margin-top: 22px; text-align: center; color: var(--dim); font-size: 12px; }

.logo {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--grad); box-shadow: 0 10px 40px -8px rgba(168, 85, 247, 0.7);
  position: relative;
}
.logo svg { width: 26px; height: 26px; }
.logo.sm { width: 36px; height: 36px; border-radius: 11px; }
.logo.sm svg { width: 18px; height: 18px; }
.logo::after {
  content: ""; position: absolute; inset: -6px; border-radius: 20px; border: 1px solid rgba(168, 85, 247, 0.5);
  animation: ping 2.6s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(0.9); opacity: 0.8; } 100% { transform: scale(1.35); opacity: 0; } }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.02em; }
.field .hint { font-size: 12px; color: var(--dim); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(8, 11, 24, 0.6); color: var(--text); font: inherit; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea.input { resize: vertical; min-height: 74px; font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.input:focus { border-color: rgba(56, 189, 248, 0.6); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14); background: rgba(8, 11, 24, 0.85); }
.input::placeholder { color: var(--dim); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
.check {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(8, 11, 24, 0.4); cursor: pointer; user-select: none;
  transition: border-color 0.2s, background 0.2s;
}
.check:hover { border-color: var(--line-hi); }
.check input { display: none; }
.check .box {
  width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--dim); display: grid; place-items: center;
  transition: all 0.25s var(--ease); flex: none;
}
.check input:checked + .box { background: var(--grad); border-color: transparent; transform: scale(1.08); }
.check input:checked + .box::after { content: ""; width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check span.t { font-size: 13px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line); cursor: pointer;
  background: var(--panel-hi); font-weight: 600; font-size: 13px; white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s, background 0.2s, opacity 0.2s;
}
.btn:hover { border-color: var(--line-hi); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--grad); border-color: transparent; color: white; box-shadow: 0 8px 26px -10px rgba(168, 85, 247, 0.9); background-size: 200% 200%; animation: gradmove 6s ease infinite; }
.btn.primary:hover { box-shadow: 0 12px 32px -8px rgba(168, 85, 247, 1); }
@keyframes gradmove { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); }
.btn.success { color: var(--green); }
.btn.success:hover { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.4); }
.btn.warn { color: var(--amber); }
.btn.warn:hover { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.4); }
.btn.block { width: 100%; padding: 13px; font-size: 14px; }
.btn.icon { padding: 8px; }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: white; animation: rot 0.7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 6px;
  background: rgba(8, 10, 22, 0.55); backdrop-filter: blur(20px); border-right: 1px solid var(--line);
  animation: slidein 0.6s var(--ease) both;
}
@keyframes slidein { from { transform: translateX(-24px); opacity: 0; } }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand b { font-size: 15px; letter-spacing: -0.01em; display: block; }
.brand small { color: var(--dim); font-size: 11.5px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); padding: 14px 12px 6px; font-weight: 700; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  color: var(--muted); font-weight: 500; transition: color 0.2s, background 0.2s;
}
.nav a svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease); }
.nav a:hover { color: var(--text); background: rgba(148, 163, 255, 0.06); }
.nav a:hover svg { transform: scale(1.12) rotate(-4deg); }
.nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(56, 189, 248, 0.14), rgba(168, 85, 247, 0.06)); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--cyan); }
.nav a .count { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: rgba(148, 163, 255, 0.1); color: var(--muted); }
.sidebar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 13px; background: rgba(148, 163, 255, 0.05); border: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: white; }
.user-chip .who { flex: 1; min-width: 0; }
.user-chip .who b { display: block; font-size: 13px; }
.user-chip .who small { color: var(--dim); font-size: 11px; }

.main { min-width: 0; padding: 28px 34px 60px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 26px; letter-spacing: -0.025em; font-weight: 800; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.topbar .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.view { animation: viewin 0.55s var(--ease) both; }
@keyframes viewin { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.stagger > * { animation: rise 0.6s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; } .stagger > *:nth-child(2) { animation-delay: 0.07s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; } .stagger > *:nth-child(4) { animation-delay: 0.17s; }
.stagger > *:nth-child(5) { animation-delay: 0.22s; } .stagger > *:nth-child(6) { animation-delay: 0.27s; }
.stagger > *:nth-child(7) { animation-delay: 0.32s; } .stagger > *:nth-child(8) { animation-delay: 0.37s; }
.stagger > *:nth-child(n+9) { animation-delay: 0.42s; }

/* ---------- cards ---------- */
.card {
  background: var(--panel); backdrop-filter: blur(18px) saturate(130%); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; position: relative; overflow: hidden;
}
.card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card h3 .sub { margin-left: auto; font-weight: 500; color: var(--dim); font-size: 12px; }
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-bottom: 18px; }
.two { grid-template-columns: 1.4fr 1fr; }
.kpi { cursor: default; transition: transform 0.35s var(--ease), box-shadow 0.35s; }
.kpi:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line-hi); }
.kpi .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.kpi .ico svg { width: 20px; height: 20px; }
.kpi .val { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.kpi .val small { font-size: 15px; color: var(--dim); font-weight: 600; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kpi .glow { position: absolute; width: 140px; height: 140px; border-radius: 50%; filter: blur(50px); opacity: 0.28; right: -40px; top: -40px; transition: opacity 0.4s; }
.kpi:hover .glow { opacity: 0.5; }
.bar { height: 6px; border-radius: 6px; background: rgba(148, 163, 255, 0.1); margin-top: 14px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); width: 0; transition: width 1.2s var(--ease); }
.c-cyan { background: rgba(56, 189, 248, 0.14); color: var(--cyan); } .g-cyan { background: var(--cyan); }
.c-violet { background: rgba(168, 85, 247, 0.14); color: var(--violet); } .g-violet { background: var(--violet); }
.c-green { background: rgba(52, 211, 153, 0.14); color: var(--green); } .g-green { background: var(--green); }
.c-pink { background: rgba(236, 72, 153, 0.14); color: var(--pink); } .g-pink { background: var(--pink); }
.c-amber { background: rgba(251, 191, 36, 0.14); color: var(--amber); } .g-amber { background: var(--amber); }

/* ---------- tables ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar .input { max-width: 280px; }
.search { position: relative; flex: 1; max-width: 320px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--dim); }
.search .input { padding-left: 38px; max-width: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(8, 11, 24, 0.6); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; transition: all 0.25s var(--ease); }
.seg button.on { background: var(--panel-hi); color: var(--text); box-shadow: 0 0 0 1px var(--line-hi); }
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); font-weight: 700; padding: 12px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 20px; border-bottom: 1px solid rgba(148, 163, 255, 0.06); vertical-align: middle; }
tbody tr { transition: background 0.2s; animation: rise 0.5s var(--ease) both; }
tbody tr:hover { background: rgba(148, 163, 255, 0.04); }
tbody tr:last-child td { border-bottom: 0; }
td .primary { font-weight: 600; }
td .secondary { color: var(--dim); font-size: 12px; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 7px; font-size: 11.5px; background: rgba(148, 163, 255, 0.08); color: var(--muted); border: 1px solid var(--line); margin: 2px 4px 2px 0; }
.tag.lock { color: var(--green); border-color: rgba(52, 211, 153, 0.25); background: rgba(52, 211, 153, 0.08); }
.tag svg { width: 12px; height: 12px; flex: none; }
.tag { white-space: nowrap; }
code.rule { font-size: 12px; color: #c4b5fd; background: rgba(168, 85, 247, 0.1); padding: 3px 8px; border-radius: 7px; word-break: break-all; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; text-transform: capitalize; border: 1px solid transparent; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; position: relative; }
.pill.ok { color: var(--green); background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.25); }
.pill.ok .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid currentColor; animation: ping 1.8s var(--ease) infinite; }
.pill.off { color: var(--muted); background: rgba(139, 147, 184, 0.1); border-color: rgba(139, 147, 184, 0.2); }
.pill.busy { color: var(--amber); background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.25); }
.pill.busy .dot { animation: blink 0.9s ease-in-out infinite; }
.pill.bad { color: var(--red); background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.25); }
@keyframes blink { 50% { opacity: 0.25; transform: scale(0.7); } }

/* toggle switch */
.switch { position: relative; width: 42px; height: 24px; display: inline-block; cursor: pointer; flex: none; }
.switch input { display: none; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(139, 147, 184, 0.25); transition: background 0.3s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform 0.35s var(--ease); }
.switch input:checked + i { background: var(--grad); box-shadow: 0 0 16px -2px rgba(168, 85, 247, 0.8); }
.switch input:checked + i::after { transform: translateX(18px); }

/* empty / skeleton */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .art { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; background: rgba(148, 163, 255, 0.06); border: 1px dashed var(--line-hi); animation: float 4s ease-in-out infinite; }
.empty .art svg { width: 32px; height: 32px; color: var(--violet); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
@keyframes float { 50% { transform: translateY(-8px); } }
.skeleton { height: 46px; border-radius: 11px; margin-bottom: 10px; background: linear-gradient(90deg, rgba(148, 163, 255, 0.05), rgba(148, 163, 255, 0.12), rgba(148, 163, 255, 0.05)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(148, 163, 255, 0.08); animation: rise 0.5s var(--ease) both; }
.feed li:last-child { border-bottom: 0; }
.feed .fi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.feed .fi svg { width: 15px; height: 15px; }
.feed .ft { flex: 1; min-width: 0; }
.feed .ft b { font-weight: 600; }
.feed .ft small { display: block; color: var(--dim); font-size: 11.5px; }

/* code block */
pre.code { margin: 0; padding: 16px; border-radius: 12px; background: rgba(4, 6, 14, 0.7); border: 1px solid var(--line); overflow: auto; max-height: 460px; font-size: 12px; line-height: 1.6; color: #cbd5ff; }
.k { color: #7dd3fc; } .s { color: #86efac; } .n { color: #fda4af; } .b { color: #c4b5fd; }
.status-line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(8, 11, 24, 0.5); border: 1px solid var(--line); margin-bottom: 14px; font-size: 13px; }
.status-line .pill { margin-left: auto; }

/* ---------- modal & drawer ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(3, 4, 10, 0.6); backdrop-filter: blur(6px); animation: fade 0.25s ease both; display: grid; place-items: center; padding: 20px; }
.backdrop.closing { animation: fade 0.2s ease reverse both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(440px, 100%); background: var(--panel-solid); border-radius: 20px; box-shadow: var(--shadow); padding: 26px; animation: pop 0.4s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.92) translateY(10px); } }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { color: var(--muted); margin: 0 0 22px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; }
.modal .mi { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; }
.modal .mi svg { width: 22px; height: 22px; }
.drawer-bg { place-items: stretch end; padding: 0; }
.drawer { width: min(560px, 100vw); height: 100vh; overflow-y: auto; background: var(--panel-solid); border-left: 1px solid var(--line); padding: 28px; animation: drawerin 0.45s var(--ease) both; }
.closing .drawer { animation: drawerin 0.25s ease reverse both; }
@keyframes drawerin { from { transform: translateX(100%); } }
.drawer header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.drawer header h3 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.drawer .foot { position: sticky; bottom: -28px; margin: 22px -28px -28px; padding: 16px 28px; background: linear-gradient(transparent, var(--panel-solid) 30%); display: flex; gap: 10px; justify-content: flex-end; }
.preview-rule { margin: -4px 0 18px; padding: 12px 14px; border-radius: 12px; border: 1px dashed rgba(168, 85, 247, 0.35); background: rgba(168, 85, 247, 0.06); font-size: 12px; color: var(--muted); }
.preview-rule code { color: #c4b5fd; display: block; margin-top: 4px; font-size: 12.5px; word-break: break-all; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); font-weight: 700; margin: 22px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 80; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 380px; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--panel-solid); box-shadow: var(--shadow); animation: toastin 0.45s var(--ease) both; position: relative; overflow: hidden; }
.toast.out { animation: toastin 0.3s ease reverse both; }
@keyframes toastin { from { opacity: 0; transform: translateX(40px) scale(0.95); } }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--green); } .toast.err svg { color: var(--red); } .toast.info svg { color: var(--cyan); }
.toast b { display: block; font-size: 13px; } .toast span { color: var(--muted); font-size: 12.5px; word-break: break-word; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; background: var(--grad); animation: life 4s linear both; }
@keyframes life { from { width: 100%; } to { width: 0; } }

.demo-banner { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; margin-bottom: 18px; font-size: 13px; color: var(--amber); background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25); animation: rise 0.5s var(--ease) both; }
.demo-banner svg { width: 18px; height: 18px; flex: none; }
.menu-btn { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: var(--sidebar); transform: translateX(-100%); transition: transform 0.4s var(--ease); animation: none; }
  .sidebar.open { transform: none; }
  .main { padding: 20px 16px 60px; }
  .two { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; }
  .row, .checks { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* inline icons in headings / status rows */
.card h3 svg, .status-line svg, .section-title svg { width: 17px; height: 17px; flex: none; color: var(--violet); }
.status-line > svg { color: var(--cyan); }

/* single sign-on */
.sso-sep { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--dim); font-size: 12px; }
.sso-sep::before, .sso-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sso-btn { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-top: 8px; text-decoration: none; color: var(--text); }
.sso-btn svg { width: 18px; height: 18px; flex: none; }
.sso-btn small { margin-left: auto; color: var(--dim); font-size: 11.5px; font-weight: 500; }

/* rds backups drawer */
.hint svg { width: 13px; height: 13px; vertical-align: -2px; }
.snap-list { display: flex; flex-direction: column; gap: 8px; }
.snap { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.snap-main { flex: 1; min-width: 0; }
.snap-main .primary { font-size: 12.5px; overflow-wrap: anywhere; }
.snap .pill, .snap .btn { flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.snap-main .tag { margin-left: 6px; font-family: inherit; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
.act-rows { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.act-rows > div { display: flex; gap: 6px; }
td.actions .act-rows .btn + .btn { margin-left: 0; }
