:root {
  --bg: #090c12;
  --bg-soft: #0d1119;
  --surface: #111722;
  --surface-2: #151d2b;
  --surface-3: #1a2434;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e9edf5;
  --muted: #8b96ab;
  --accent: #53fc18;
  --accent-soft: rgba(83, 252, 24, 0.12);
  --cyan: #22d3ee;
  --purple: #a78bfa;
  --danger: #ff5d6c;
  --warning: #fbbf24;
  --success: #34d399;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(60% 44% at 50% -10%, rgba(83, 252, 24, 0.07), transparent 70%),
    radial-gradient(40% 30% at 100% 0%, rgba(34, 211, 238, 0.05), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #b9f6a5;
}

::selection {
  background: rgba(83, 252, 24, 0.25);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.aurora {
  position: fixed;
  inset: -20% -10% auto;
  height: 60vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(40% 60% at 18% 20%, rgba(83, 252, 24, 0.13), transparent 70%),
    radial-gradient(35% 55% at 78% 8%, rgba(139, 92, 246, 0.12), transparent 70%);
  filter: blur(40px);
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17, 23, 34, 0.96), rgba(9, 12, 18, 0.92));
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #04150a;
  background: linear-gradient(135deg, #53fc18, #1fd17a);
  box-shadow: 0 8px 24px rgba(83, 252, 24, 0.28);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-mark.large {
  width: 50px;
  height: 50px;
  border-radius: 15px;
}

.brand-mark.large svg {
  width: 28px;
  height: 28px;
}

.brand-text {
  display: grid;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 17px;
  letter-spacing: -0.3px;
}

.brand-text small {
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.nav {
  display: grid;
  gap: 5px;
  margin-top: 34px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  opacity: 0.85;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(83, 252, 24, 0.13), rgba(83, 252, 24, 0.02));
  box-shadow: inset 0 0 0 1px rgba(83, 252, 24, 0.14);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 12px rgba(83, 252, 24, 0.7);
}

.nav-item.active svg {
  color: var(--accent);
  opacity: 1;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.connection-card div {
  display: grid;
  line-height: 1.35;
}

.connection-card strong {
  font-size: 12px;
}

.connection-card small {
  color: var(--muted);
  font-size: 11px;
}

.version {
  color: rgba(139, 150, 171, 0.55);
  font-size: 10.5px;
  text-align: center;
  letter-spacing: 0.4px;
}

.status-dot,
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted);
}

.status-dot.online,
.dot.online {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(83, 252, 24, 0.1), 0 0 14px rgba(83, 252, 24, 0.6);
}

.status-dot.offline,
.dot.offline {
  background: #586174;
}

.main {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 34px 40px 64px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.topbar-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.7px;
  line-height: 1.15;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.7px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12.5px;
  color: #c9d2e1;
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(83, 252, 24, 0.3), rgba(34, 211, 238, 0.25));
  color: #d9ffcd;
  font-size: 12px;
  font-weight: 700;
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
}

.menu-toggle {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #04150a;
  background: linear-gradient(135deg, #53fc18, #1fd17a);
  box-shadow: 0 10px 24px rgba(83, 252, 24, 0.18);
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 30px rgba(83, 252, 24, 0.26);
}

.btn-ghost {
  color: #c9d2e1;
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: var(--border-strong);
}

.btn-danger {
  color: #ff9aa3;
  background: rgba(255, 93, 108, 0.09);
  border-color: rgba(255, 93, 108, 0.22);
}

.btn-danger:hover {
  background: rgba(255, 93, 108, 0.16);
}

.btn-small {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 29, 43, 0.82), rgba(15, 21, 31, 0.94));
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
  animation: fade-up 0.45s ease both;
}

.main > .card,
.main > .two-col,
.main > .stats-grid {
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-header .eyebrow {
  font-size: 10px;
  margin-bottom: 3px;
}

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.setup-card {
  border-color: rgba(83, 252, 24, 0.2);
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(83, 252, 24, 0.09), transparent 60%),
    linear-gradient(180deg, rgba(21, 29, 43, 0.9), rgba(15, 21, 31, 0.96));
}

.checklist {
  display: grid;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.check-item div {
  display: grid;
  flex: 1;
  line-height: 1.35;
}

.check-item strong {
  font-size: 13px;
}

.check-item small {
  color: var(--muted);
  font-size: 11.5px;
}

.check-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.check-item.done .check-icon {
  color: #04150a;
  background: linear-gradient(135deg, #53fc18, #1fd17a);
}

.check-item.done strong {
  color: #cfe9c7;
}

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

.stat-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(24, 33, 48, 0.75), rgba(14, 20, 30, 0.9));
  animation: fade-up 0.45s ease both;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -30px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(83, 252, 24, 0.08), transparent 70%);
}

.stat-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--accent);
  background: rgba(83, 252, 24, 0.08);
  border: 1px solid rgba(83, 252, 24, 0.12);
}

.stat-icon svg {
  width: 17px;
  height: 17px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.stat-value {
  display: block;
  margin: 10px 0 3px;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1;
}

.stat-card small {
  color: var(--muted);
  font-size: 11px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.status-list {
  display: grid;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
}

.status-row:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-row > span:first-child {
  color: var(--muted);
}

.status-value {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
  color: #d5ddea;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-success {
  color: #8bf0b9;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.18);
}

.badge-danger {
  color: #ff9aa3;
  background: rgba(255, 93, 108, 0.1);
  border-color: rgba(255, 93, 108, 0.2);
}

.badge-warning {
  color: #fcd68a;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

.badge-neutral {
  color: #a8b3c5;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.07);
}

.badge-purple {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.2);
}

.badge-live {
  color: #a8ff7d;
  background: rgba(83, 252, 24, 0.12);
  border-color: rgba(83, 252, 24, 0.28);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 18px rgba(83, 252, 24, 0.12);
}

.live-body {
  display: grid;
  gap: 10px;
}

.live-title {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.live-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.live-meta strong {
  color: var(--text);
}

.offline-illustration {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 1px dashed rgba(139, 150, 171, 0.35);
  background: radial-gradient(circle, rgba(139, 150, 171, 0.12), transparent 70%);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
}

.empty.compact {
  padding: 24px 16px;
}

.empty p {
  margin: 0;
  font-size: 13.5px;
  color: #c9d2e1;
}

.empty small {
  max-width: 340px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -6px;
  padding: 0 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: left;
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
  vertical-align: top;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.align-right {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.message-cell {
  max-width: 440px;
  color: #c3ccdb;
  word-break: break-word;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.row-actions form {
  display: inline-flex;
}

.command-code {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid rgba(83, 252, 24, 0.16);
  border-radius: 7px;
  background: rgba(83, 252, 24, 0.06);
  color: #a8ff7d;
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: nowrap;
}

.rank-list {
  display: grid;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-item:last-child {
  border-bottom: 0;
}

.rank-position {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.rank-item:first-child .rank-position {
  color: #04150a;
  background: linear-gradient(135deg, #53fc18, #1fd17a);
}

.rank-bar {
  flex: 1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.rank-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #53fc18, #1fd17a);
  opacity: 0.75;
}

.rank-value {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.page-actions-text {
  display: grid;
  line-height: 1.4;
}

.page-actions-text strong {
  font-size: 13.5px;
}

.page-actions-text span {
  color: var(--muted);
  font-size: 11.5px;
}

.stack {
  display: grid;
  gap: 18px;
}

.stack.tight {
  gap: 10px;
}

.field {
  display: grid;
  gap: 7px;
  align-content: start;
}

.label {
  color: #c9d2e1;
  font-size: 12.5px;
  font-weight: 600;
}

.hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  outline: none;
  background: rgba(5, 8, 13, 0.55);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(139, 150, 171, 0.6);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(83, 252, 24, 0.45);
  background: rgba(5, 8, 13, 0.72);
  box-shadow: 0 0 0 3px rgba(83, 252, 24, 0.09);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.input-group {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: rgba(5, 8, 13, 0.55);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group:focus-within {
  border-color: rgba(83, 252, 24, 0.45);
  box-shadow: 0 0 0 3px rgba(83, 252, 24, 0.09);
}

.input-group .input {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.input-prefix,
.input-suffix {
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.input-suffix {
  border-left: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.field-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.counter {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

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

.form-grid.four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.inline-form .input {
  flex: 1;
  min-width: 150px;
}

.inline-form.grow {
  flex: 1;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.checkbox-inline input {
  accent-color: var(--accent);
}

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cfd6e3;
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch-row input:checked + .switch {
  background: linear-gradient(135deg, #53fc18, #1fd17a);
}

.switch-row input:checked + .switch::after {
  transform: translateX(18px);
  background: #04150a;
}

.switch-row input:focus-visible + .switch {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch-row > span:last-child {
  display: grid;
  line-height: 1.35;
}

.switch-row strong {
  font-size: 12.5px;
  font-weight: 600;
}

.switch-row small {
  color: var(--muted);
  font-size: 11px;
}

.switch-row.standalone,
.card-inset {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

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

.variable-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.variable-chip {
  padding: 5px 10px;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.07);
  color: #c4b5fd;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.variable-chip:hover {
  background: rgba(167, 139, 250, 0.14);
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12.5px;
  animation: fade-up 0.3s ease both;
}

.flash.static {
  margin-bottom: 18px;
}

.flash-success {
  border-color: rgba(52, 211, 153, 0.24);
  background: rgba(52, 211, 153, 0.08);
  color: #a7f3cf;
}

.flash-error {
  border-color: rgba(255, 93, 108, 0.25);
  background: rgba(255, 93, 108, 0.08);
  color: #ffb3b9;
}

.flash-warning {
  border-color: rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.08);
  color: #f5dfa7;
}

.flash-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.flash-close:hover {
  opacity: 1;
}

.flash.hide {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.inline-alert {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: #b6c0d1;
  font-size: 12px;
  line-height: 1.5;
}

.inline-alert code {
  font-size: 0.85em;
}

.inline-alert-info {
  border-color: rgba(34, 211, 238, 0.2);
  background: rgba(34, 211, 238, 0.06);
  color: #b7ecf5;
}

.inline-alert-warning {
  border-color: rgba(251, 191, 36, 0.22);
  background: rgba(251, 191, 36, 0.07);
  color: #f5dfa7;
}

.inline-alert-error {
  border-color: rgba(255, 93, 108, 0.24);
  background: rgba(255, 93, 108, 0.07);
  color: #ffb3b9;
  margin-top: 14px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.tag-item small {
  color: var(--muted);
  font-size: 10px;
}

.tag-item form {
  display: inline-flex;
}

.tag-remove {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.tag-remove:hover {
  background: rgba(255, 93, 108, 0.12);
  color: #ff9aa3;
}

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.tab {
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.logs-header {
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.search-form .input {
  max-width: 300px;
}

.list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px;
  color: var(--muted);
  font-size: 11.5px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 18px;
}

.pagination-info {
  color: var(--muted);
  font-size: 11.5px;
}

.builtin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.builtin-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.builtin-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.chat-preview {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.85), rgba(11, 16, 24, 0.95)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.005) 0 10px, transparent 10px 20px);
}

.chat-message {
  display: flex;
  gap: 10px;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #53fc18, #1fd17a);
  color: #04150a;
  font-size: 13px;
  font-weight: 800;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.chat-message p {
  margin: 3px 0 0;
  color: #d7deea;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-note {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px dashed var(--border-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.015);
}

.preview-note strong {
  font-size: 11.5px;
  color: #c9d2e1;
}

.preview-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.counter.is-near-limit {
  color: var(--warning);
}

.counter.is-over-limit {
  color: var(--danger);
}

.integration-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.copy-list {
  display: grid;
  gap: 9px;
  margin-bottom: 20px;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.copy-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.copy-row strong {
  font-size: 12.5px;
}

.copy-row small {
  color: var(--muted);
  font-size: 11px;
}

.copy-row code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
  font-size: 11px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.step {
  display: flex;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.step > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #a8ff7d;
  font-size: 11px;
  font-weight: 700;
}

.step div {
  display: grid;
  gap: 3px;
}

.step strong {
  font-size: 12px;
}

.step small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.password-field {
  position: relative;
  display: block;
}

.password-field .input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.login-page,
.simple-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 16px;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 38px 36px 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(23, 31, 46, 0.92), rgba(12, 17, 26, 0.97));
  box-shadow: var(--shadow);
  animation: fade-up 0.5s ease both;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(83, 252, 24, 0.7), transparent);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
}

.login-brand > span:last-child {
  display: grid;
  line-height: 1.2;
}

.login-brand strong {
  font-size: 18px;
  letter-spacing: -0.3px;
}

.login-brand small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.login-card h1 {
  margin: 4px 0 0;
  font-size: 27px;
  letter-spacing: -0.8px;
}

.login-subtitle {
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.login-card .stack {
  gap: 15px;
}

.login-foot {
  margin: 24px 0 0;
  color: rgba(139, 150, 171, 0.65);
  font-size: 10.5px;
  text-align: center;
  letter-spacing: 0.3px;
}

.error-shell {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
}

.error-card {
  padding: 44px 36px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(23, 31, 46, 0.92), rgba(12, 17, 26, 0.97));
  box-shadow: var(--shadow);
  text-align: center;
}

.error-code {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
}

.error-card h1 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: -0.5px;
}

.error-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@media (max-width: 1024px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    transition: left 0.25s ease;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.5);
  }

  .menu-toggle {
    display: inline-grid;
  }

  .main {
    padding: 26px 24px 56px;
  }
}

@media (max-width: 840px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid,
  .form-grid.four,
  .rule-grid,
  .builtin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .user-name {
    display: none;
  }

  .copy-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .copy-row .btn {
    align-self: flex-end;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 20px 16px 48px;
  }

  .card {
    padding: 18px;
  }

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

  .topbar h1 {
    font-size: 22px;
  }

  .topbar-actions .btn-ghost {
    display: none;
  }

  .page-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions .btn {
    width: 100%;
  }

  .search-form {
    width: 100%;
    justify-content: flex-start;
  }

  .search-form .input {
    max-width: none;
  }

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

  .list-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }
}

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

.nav {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding-right: 2px;
}

.nav::-webkit-scrollbar {
  width: 4px;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.nav-label {
  margin: 14px 14px 3px;
  color: rgba(139, 150, 171, 0.55);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.mini-card {
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(24, 33, 48, 0.62), rgba(14, 20, 30, 0.85));
  animation: fade-up 0.45s ease both;
}

.mini-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mini-card strong {
  display: block;
  margin: 7px 0 3px;
  overflow: hidden;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card small {
  color: var(--muted);
  font-size: 10.5px;
}

.giveaway-active {
  border-color: rgba(83, 252, 24, 0.22);
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(83, 252, 24, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(21, 29, 43, 0.9), rgba(15, 21, 31, 0.96));
}

.giveaway-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.giveaway-prize {
  display: block;
  margin-bottom: 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.giveaway-hero small {
  color: var(--muted);
  font-size: 11.5px;
}

.giveaway-stats {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.giveaway-stats strong {
  color: var(--text);
}

.giveaway-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.detail-item {
  display: grid;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.detail-item > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-item strong {
  font-size: 15px;
  letter-spacing: -0.2px;
}

.detail-item small {
  color: var(--muted);
  font-size: 10.5px;
}

.winner-list {
  display: grid;
  gap: 8px;
}

.winner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(83, 252, 24, 0.18);
  border-radius: 12px;
  background: rgba(83, 252, 24, 0.06);
}

.winner-item strong {
  font-size: 14px;
}

.winner-item small {
  color: var(--muted);
  font-size: 10.5px;
}

.winner-trophy {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #53fc18, #1fd17a);
  color: #04150a;
  font-size: 15px;
}

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

@media (max-width: 840px) {
  .detail-grid,
  .giveaway-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .giveaway-cta {
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .mini-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav {
    max-height: none;
  }
}

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

.event-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.event-card .field {
  gap: 5px;
}

@media (max-width: 840px) {
  .event-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
