@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  --bg:    #09090b;
  --bg-1:  #0f0f12;
  --bg-2:  #141418;
  --bg-3:  #1a1a1f;
  --bg-4:  #222228;

  --b0: rgba(255,255,255,0.05);
  --b1: rgba(255,255,255,0.09);
  --b2: rgba(255,255,255,0.15);
  --b3: rgba(255,255,255,0.25);

  --a:    #6366f1;
  --a-hi: #818cf8;
  --a-lo: #3730a3;
  --a-bg: rgba(99,102,241,0.10);
  --a-bd: rgba(99,102,241,0.25);

  --green: #34d399;
  --red:   #f87171;
  --amber: #fbbf24;
  --blue:  #60a5fa;

  --fg:   #fafafa;
  --fg-2: #d4d4d8;
  --fg-3: #a1a1aa;
  --fg-4: #52525b;

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --r:    7px;
  --r-sm: 5px;
  --r-lg: 11px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur:  110ms;
  --dur2: 180ms;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5714;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

#star-canvas { display: none !important; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%,
      rgba(99,102,241,0.09) 0%,
      transparent 60%),
    var(--bg);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(255,255,255,0.025) 1px,
    transparent 1px
  );
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.app, .auth-wrapper, main, aside,
.modal-overlay, .lnav, .hero, .section, .ldiv, footer, .lfooter { position: relative; z-index: 1; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-4); }

.auth-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth-glow-ring {
  position: relative;
  width: 100%;
  max-width: 400px;
  border-radius: calc(var(--r-lg) + 1.5px);
  padding: 1.5px;
  animation: riseIn 0.4s var(--ease) both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@property --rot { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes rotBorder { to { --rot: 360deg; } }

.auth-glow-ring::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--rot, 0deg),
    transparent    0deg,
    var(--a)       70deg,
    #a78bfa       130deg,
    var(--a)       190deg,
    transparent    250deg,
    transparent    360deg
  );
  animation: rotBorder 4.5s linear infinite;
  z-index: 0;
}

.auth-glow-ring::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--rot, 0deg),
    transparent    0deg,
    rgba(99,102,241,0.3)  70deg,
    rgba(167,139,250,0.25) 130deg,
    rgba(99,102,241,0.22) 190deg,
    transparent    250deg,
    transparent    360deg
  );
  animation: rotBorder 4.5s linear infinite;
  filter: blur(16px);
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--b2);
  padding: 2.25rem;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 20px 50px rgba(0,0,0,0.5);
}

.auth-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.75rem;
}

.auth-wordmark-icon {
  width: 27px; height: 27px;
  border-radius: 6px;
  background: var(--a);
  flex-shrink: 0;
  position: relative;
}


.auth-wordmark-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.025em;
}
.auth-wordmark-name span { color: var(--a-hi); }

.auth-heading {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--fg);
  line-height: 1.1;
  margin-bottom: 4px;
}

.auth-sub {
  font-size: 13.5px;
  color: var(--fg-3);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.auth-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1rem 0;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--fg-4);
}
.auth-sep::before, .auth-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--b1);
}

.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--fg-4);
  margin-top: 1.1rem;
}
.auth-footer a {
  color: var(--a-hi);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer a:hover { color: var(--fg); }

.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-3);
  margin-bottom: 6px;
}

input[type=text],
input[type=email],
input[type=password],
select,
textarea {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--b2);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  color: var(--fg);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--a-hi);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

input::placeholder, textarea::placeholder {
  color: var(--fg-4);
  opacity: 1;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 28px;
  cursor: pointer;
}

select option { background: var(--bg-3); color: var(--fg); }

.strength-track {
  height: 2px;
  background: var(--b1);
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width 0.3s, background 0.3s;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--r-sm);
  border: none;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: background var(--dur), color var(--dur), border-color var(--dur),
              box-shadow var(--dur), transform var(--dur);
  user-select: none;
  -webkit-appearance: none;
}

.btn-primary {
  background: var(--a);
  color: #fff;
  width: 100%;
  border: 1px solid rgba(129,140,248,0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover {
  background: var(--a-hi);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-3);
  color: var(--fg-2);
  border: 1px solid var(--b2);
}
.btn-secondary:hover {
  background: var(--bg-4);
  color: var(--fg);
  border-color: var(--b3);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-3);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--bg-2);
  color: var(--fg-2);
  border-color: var(--b1);
}

.btn-danger {
  background: rgba(248,113,113,0.08);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.2);
  padding: 5px 10px;
  font-size: 12px;
}
.btn-danger:hover { background: rgba(248,113,113,0.15); }

.btn-sm  { padding: 5px 10px; font-size: 12.5px; }
.btn-xs  { padding: 3px 7px;  font-size: 11.5px; }
.btn.loading { pointer-events: none; opacity: 0.55; }

.ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px; height: 27px;
  border-radius: var(--r-sm);
  border: 1px solid var(--b1);
  background: transparent;
  color: var(--fg-4);
  cursor: pointer;
  transition: all var(--dur);
  flex-shrink: 0;
}
.ibtn:hover { background: var(--bg-3); color: var(--fg-2); border-color: var(--b2); }
.ibtn svg   { width: 13px; height: 13px; stroke-width: 1.8; }

.alert {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 14px;
  display: none;
}
.alert.show    { display: block; }
.alert-error   { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.22); color: #fca5a5; }
.alert-success { background: rgba(52,211,153,0.08);  border: 1px solid rgba(52,211,153,0.22);  color: #6ee7b7; }
.alert-warning { background: rgba(251,191,36,0.08);  border: 1px solid rgba(251,191,36,0.22);  color: #fde68a; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 212px;
  min-width: 212px;
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--b1);
  display: flex;
  flex-direction: column;
  padding: 12px 0 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  margin-bottom: 18px;
}

.sidebar-brand-icon {
  width: 24px; height: 24px;
  border-radius: 5px;
  background: var(--a);
  flex-shrink: 0;
  position: relative;
}


.sidebar-brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.sidebar-brand-name b { color: var(--a-hi); font-weight: 700; }

.nav-group { padding: 0 6px; margin-bottom: 2px; }

.nav-group-label {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-4);
  padding: 0 6px;
  margin-bottom: 2px;
  font-weight: 500;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  color: var(--fg-3);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background var(--dur), color var(--dur);
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-link svg {
  width: 14px; height: 14px;
  stroke-width: 1.7;
  flex-shrink: 0;
  color: var(--fg-4);
  transition: color var(--dur);
}
.nav-link:hover { background: var(--bg-3); color: var(--fg-2); }
.nav-link:hover svg { color: var(--fg-3); }
.nav-link.active {
  background: var(--a-bg);
  color: var(--a-hi);
  border-color: var(--a-bd);
}
.nav-link.active svg { color: var(--a-hi); }
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: var(--a-hi);
  border-radius: 0 2px 2px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--a);
  color: #fff;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.nav-sep {
  height: 1px;
  background: var(--b0);
  margin: 5px 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 10px 0;
  border-top: 1px solid var(--b1);
}

.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px;
  border-radius: var(--r-sm);
  cursor: default;
  transition: background var(--dur);
}
.user-row:hover { background: var(--bg-3); }

.user-av {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
}

.user-name { font-size: 12.5px; font-weight: 600; color: var(--fg); letter-spacing: -0.02em; line-height: 1.3; }
.user-role { font-size: 9.5px; font-family: var(--mono); color: var(--a-hi); text-transform: uppercase; letter-spacing: 0.06em; }

.logout-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--fg-4);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  transition: color var(--dur), background var(--dur);
  display: flex;
}
.logout-btn:hover { color: var(--red); background: rgba(248,113,113,0.08); }
.logout-btn svg { width: 13px; height: 13px; stroke-width: 2; }

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px;
  overflow-y: auto;
}

.page-hd {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--fg);
  line-height: 1;
}

.page-sub {
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 3px;
  letter-spacing: -0.005em;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--bg-2);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  padding: 15px 16px;
  transition: border-color var(--dur);
}
.stat-box:hover { border-color: var(--b2); }

.stat-lbl {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-3);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--fg);
  line-height: 1;
}

.stat-hint {
  font-size: 11px;
  color: var(--fg-4);
  margin-top: 4px;
}

.panel {
  background: var(--bg-2);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 16px;
}

.panel-head {
  padding: 11px 16px;
  border-bottom: 1px solid var(--b0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0,0,0,0.12);
}

.panel-title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 6px;
}
.panel-title svg { width: 13px; height: 13px; color: var(--fg-3); stroke-width: 1.8; flex-shrink: 0; }

.panel-body { padding: 16px; }
.panel-body-flush {}

.card {
  background: var(--bg-2);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}
.card-title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-title svg { width: 13px; height: 13px; color: var(--fg-3); stroke-width: 1.8; flex-shrink: 0; }


.tbl-wrap { overflow-x: auto; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.tbl th {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-3);
  font-weight: 500;
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--b1);
  background: rgba(0,0,0,0.12);
  white-space: nowrap;
}

.tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--b0);
  color: var(--fg-2);
  vertical-align: middle;
  font-size: 13px;
}

.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background var(--dur); }
.tbl tbody tr:hover td { background: var(--bg-3); color: var(--fg); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 500;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.75;
}

.badge-admin     { background: var(--a-bg); color: var(--a-hi); border: 1px solid var(--a-bd); }
.badge-user      { background: rgba(255,255,255,0.05); color: var(--fg-3); border: 1px solid var(--b1); }
.badge-running   { background: rgba(251,191,36,0.1); color: var(--amber); border: 1px solid rgba(251,191,36,0.25); animation: pulse-run 2s ease-in-out infinite; }
.badge-completed { background: rgba(52,211,153,0.1); color: var(--green); border: 1px solid rgba(52,211,153,0.25); }
.badge-failed    { background: rgba(248,113,113,0.1); color: var(--red); border: 1px solid rgba(248,113,113,0.25); }
.badge-pending   { background: rgba(255,255,255,0.05); color: var(--fg-3); border: 1px solid var(--b1); }
.badge-channel   { background: rgba(96,165,250,0.1); color: var(--blue); border: 1px solid rgba(96,165,250,0.25); }

@keyframes pulse-run { 50% { opacity: 0.65; } }

.tabs {
  display: flex;
  border-bottom: 1px solid var(--b1);
  margin-bottom: 20px;
  gap: 0;
}

.tab {
  padding: 8px 13px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-4);
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font-family: var(--font);
  transition: color var(--dur);
  letter-spacing: -0.01em;
}
.tab:hover { color: var(--fg-2); }
.tab.active {
  color: var(--fg);
  border-bottom-color: var(--a-hi);
}

.msg-list {
  display: flex;
  flex-direction: column;
}

.msg {
  padding: 9px 13px;
  border-bottom: 1px solid var(--b0);
  transition: background var(--dur);
  position: relative;
}
.msg:first-child { border-top: 1px solid var(--b0); }
.msg:hover { background: var(--bg-3); }
.msg::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; bottom: 15%;
  width: 2px;
  background: var(--a-hi);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity var(--dur);
}
.msg:hover::before { opacity: 1; }

.msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.msg-author {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--a-hi);
}
.msg-id {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-4);
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--b1);
}
.msg-channel {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-3);
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--b1);
}
.msg-time {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-4);
}
.msg-body {
  font-size: 13.5px;
  color: var(--fg-2);
  line-height: 1.55;
  word-break: break-word;
}
.msg-body.empty { color: var(--fg-4); font-style: italic; font-size: 12.5px; }

.msg-attachments { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.attach-chip {
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(96,165,250,0.07);
  border: 1px solid rgba(96,165,250,0.18);
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--blue);
}

.pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 16px;
}

.page-btn {
  padding: 5px 9px;
  background: transparent;
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  color: var(--fg-3);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  transition: all var(--dur);
}
.page-btn:hover:not(:disabled) {
  border-color: var(--a-hi);
  color: var(--a-hi);
  background: var(--a-bg);
}
.page-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.page-btn.active {
  background: var(--a);
  border-color: var(--a-hi);
  color: #fff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur2);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-3);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: translateY(12px) scale(0.98);
  transition: transform var(--dur2) var(--ease);
}
.modal-overlay.show .modal { transform: none; }

.modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 1.25rem;
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: transparent;
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  padding: 3px 7px;
  color: var(--fg-3);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font);
  transition: all var(--dur);
}
.modal-close:hover { color: var(--fg); border-color: var(--b2); background: var(--bg-4); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  gap: 8px;
  text-align: center;
}
.empty svg { width: 30px; height: 30px; color: var(--fg-4); stroke-width: 1.5; margin-bottom: 4px; }
.empty-title { font-size: 13.5px; font-weight: 600; color: var(--fg-2); letter-spacing: -0.02em; }
.empty-sub   { font-size: 13px; color: var(--fg-3); }

.spin {
  display: inline-block;
  width: 15px; height: 15px;
  border: 1.5px solid var(--b2);
  border-top-color: var(--a-hi);
  border-radius: 50%;
  animation: rotate 0.55s linear infinite;
  flex-shrink: 0;
}
@keyframes rotate { to { transform: rotate(360deg); } }


.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row input { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.filter-grid .form-group { margin: 0; }

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.type-opt {
  padding: 11px 12px;
  background: var(--bg-1);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color var(--dur), background var(--dur);
  position: relative;
  text-align: left;
}
.type-opt:hover { border-color: var(--b2); background: var(--bg-2); }
.type-opt.selected { border-color: var(--a-hi); background: var(--a-bg); }

.type-opt-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  margin-bottom: 8px;
  transition: all var(--dur);
}
.type-opt-icon svg { width: 14px; height: 14px; stroke-width: 1.7; }
.type-opt.selected .type-opt-icon { background: rgba(99,102,241,0.2); color: var(--a-hi); }

.type-opt-label { font-size: 12.5px; font-weight: 600; color: var(--fg-2); letter-spacing: -0.01em; }
.type-opt-desc  { font-size: 11px; color: var(--fg-4); margin-top: 2px; }
.type-opt.selected .type-opt-label { color: var(--a-hi); }

.preferred-tag {
  position: absolute;
  top: 6px; right: 6px;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.18);
  border-radius: 3px;
  padding: 1px 5px;
}

.req-card {
  background: var(--bg-2);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color var(--dur);
}
.req-card:hover { border-color: var(--b2); }
.req-card.s-pending  { border-left: 2px solid var(--amber); }
.req-card.s-accepted { border-left: 2px solid var(--green); }
.req-card.s-rejected { border-left: 2px solid var(--red); }

.req-card-head {
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.req-type-label {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-3);
  margin-bottom: 3px;
  font-weight: 500;
}
.req-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
  word-break: break-all;
}

.req-note {
  padding: 9px 14px;
  border-top: 1px solid var(--b0);
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.55;
}
.req-note-label {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  margin-bottom: 3px;
  font-weight: 500;
}

.req-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--b0);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(0,0,0,0.08);
}
.req-meta-text {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-4);
}

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

.pill {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--b1);
  color: var(--fg-3);
  background: transparent;
  transition: all var(--dur);
  font-family: var(--font);
  letter-spacing: -0.01em;
}
.pill:hover { border-color: var(--b2); color: var(--fg-2); background: var(--bg-2); }
.pill.active { background: var(--a-bg); border-color: var(--a-bd); color: var(--a-hi); }

.profile-hero {
  background: var(--bg-2);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 16px;
}

.profile-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid var(--b2);
  background: var(--a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.profile-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--fg);
  line-height: 1.1;
}
.profile-handle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
  margin: 3px 0 8px;
}
.profile-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--b1);
  color: var(--fg-3);
  background: var(--bg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chip.a  { color: var(--a-hi); border-color: var(--a-bd); background: var(--a-bg); }
.chip.g  { color: var(--green); border-color: rgba(52,211,153,0.25); background: rgba(52,211,153,0.07); }
.chip.am { color: var(--amber); border-color: rgba(251,191,36,0.25); background: rgba(251,191,36,0.07); }

.profile-stats {
  display: flex;
  gap: 28px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--b1);
  flex-wrap: wrap;
}
.pstat-val   { font-size: 22px; font-weight: 700; letter-spacing: -0.05em; color: var(--fg); line-height: 1; }
.pstat-label { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-3); margin-top: 3px; font-weight: 500; }

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) { .profile-grid { grid-template-columns: 1fr; } }

.guild-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--b0);
}
.guild-row:last-child { border-bottom: none; }

.guild-ico {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: var(--bg-4);
  border: 1px solid var(--b1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-3);
  flex-shrink: 0;
  overflow: hidden;
}
.guild-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

.guild-name  { font-size: 13px; font-weight: 600; color: var(--fg); letter-spacing: -0.02em; }
.guild-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.guild-meta-item { font-family: var(--mono); font-size: 10.5px; color: var(--fg-4); }
.guild-meta-item b { color: var(--fg-2); }

.guild-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.gtag {
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid;
}
.gtag.pending  { color: var(--amber); border-color: rgba(251,191,36,0.22); background: rgba(251,191,36,0.07); }
.gtag.boost    { color: #f472b6; border-color: rgba(244,114,182,0.22); background: rgba(244,114,182,0.07); }
.gtag.timeout  { color: var(--red); border-color: rgba(248,113,113,0.22); background: rgba(248,113,113,0.07); }
.gtag.nick     { color: var(--a-hi); border-color: var(--a-bd); background: var(--a-bg); }
.gtag.msgs-only{ color: var(--blue); border-color: rgba(96,165,250,0.22); background: rgba(96,165,250,0.07); }

.guild-bar { margin-top: 6px; height: 2px; background: var(--b1); border-radius: 99px; overflow: hidden; }
.guild-bar-fill { height: 100%; background: var(--a); border-radius: 99px; }

.chan-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--b0);
}
.chan-row:last-child { border-bottom: none; }
.chan-name  { font-family: var(--mono); font-size: 12px; color: var(--fg-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-guild { font-size: 11px; color: var(--fg-4); white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.chan-bar   { width: 40px; height: 2px; background: var(--b1); border-radius: 99px; overflow: hidden; flex-shrink: 0; }
.chan-bar-fill { height: 100%; background: var(--a); border-radius: 99px; }
.chan-count { font-family: var(--mono); font-size: 11px; color: var(--a-hi); font-weight: 600; white-space: nowrap; }

.act-chart { display: flex; align-items: flex-end; gap: 3px; height: 54px; }
.act-bar {
  flex: 1; min-width: 3px; max-width: 18px;
  background: var(--a-lo);
  border-radius: 2px 2px 0 0;
  transition: background var(--dur);
  position: relative; cursor: default;
}
.act-bar:hover { background: var(--a-hi); }
.act-bar:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg-4);
  border: 1px solid var(--b2);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}
.act-foot { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--mono); font-size: 10px; color: var(--fg-4); }

.srule {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-4); font-weight: 500;
}
.srule::after { content: ''; flex: 1; height: 1px; background: var(--b0); }

code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--bg-3);
  border: 1px solid var(--b1);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--a-hi);
}

.note-box {
  background: rgba(251,191,36,0.05);
  border: 1px solid rgba(251,191,36,0.15);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.65;
}
.note-box li { margin-left: 16px; }

.token-note { font-family: var(--mono); font-size: 10.5px; color: var(--green); margin-top: 5px; }

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--b1);
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-3);
}
.result-meta b { color: var(--a-hi); }

.type-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.type-card {
  padding: 11px 12px;
  background: var(--bg-1);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color var(--dur), background var(--dur);
  position: relative;
}
.type-card:hover { border-color: var(--b2); background: var(--bg-2); }
.type-card.selected { border-color: var(--a-hi); background: var(--a-bg); }
.type-card-label { font-size: 12.5px; font-weight: 600; color: var(--fg-2); letter-spacing: -0.01em; }
.type-card-desc  { font-size: 11px; color: var(--fg-4); margin-top: 2px; }
.type-card.selected .type-card-label { color: var(--a-hi); }
.type-card-check {
  position: absolute; top: 8px; right: 8px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--b2);
  transition: all var(--dur);
}
.type-card.selected .type-card-check { background: var(--a-hi); border-color: var(--a-hi); }

.pw-strength { height: 4px; border-radius: 99px; margin-top: 6px; background: var(--bg-4); overflow: hidden; }
.pw-strength-bar { height: 100%; border-radius: 99px; transition: width 0.3s, background 0.3s; width: 0; }
.pw-hint { font-size: 11px; font-family: var(--mono); margin-top: 4px; color: var(--fg-4); }

.t1 { color: var(--fg); }
.t2 { color: var(--fg-2); }
.t3 { color: var(--fg-3); }
.mono { font-family: var(--mono); }
.ml-auto { margin-left: auto; }
.flex { display: flex; align-items: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fade-up { animation: fadeUp var(--dur2) var(--ease) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger > * { animation: fadeUp var(--dur2) var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 20ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 60ms; }
.stagger > *:nth-child(4) { animation-delay: 80ms; }
.stagger > *:nth-child(5) { animation-delay: 100ms; }

@media (max-width: 768px) {
  .sidebar   { display: none; }
  .main      { padding: 16px; }
  .grid-2    { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; }
  .page-title{ font-size: 17px; }
}

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
  gap: 2px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; flex-shrink: 0; }

@media (max-width: 480px) {
  .type-grid { grid-template-columns: 1fr; }
  .type-opt  { flex-direction: row; gap: 12px; padding: 10px 14px; }
  .type-opt-icon { width: 32px; height: 32px; flex-shrink: 0; }
}

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr !important; }
  .filter-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 860px) {
  .tbl th:nth-child(3), .tbl td:nth-child(3),  
  .tbl th:nth-child(8), .tbl td:nth-child(8)   
  { display: none; }
}
@media (max-width: 640px) {
  .tbl th:nth-child(6), .tbl td:nth-child(6),   
  .tbl th:nth-child(7), .tbl td:nth-child(7)  
  { display: none; }
  .tbl th:nth-child(5), .tbl td:nth-child(5),   
  .tbl th:nth-child(7), .tbl td:nth-child(7),   
  .tbl th:nth-child(9), .tbl td:nth-child(9)    
  { display: none; }
}

.panel-body-flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 24px; }
}

@media (max-width: 480px) {
  .page-hd { flex-direction: column; gap: 10px; align-items: flex-start; }
  .page-title { font-size: 16px; }
  .page-sub   { font-size: 11px; }
}

@media (max-width: 600px) {
  .panel-head { flex-wrap: wrap; gap: 8px; }
  .panel-title { font-size: 13px; }
}

@media (max-width: 400px) {
  .input-row { flex-direction: column; }
  .input-row .btn { width: 100%; }
}

@media (max-width: 600px) {
  .profile-top { flex-direction: column; gap: 12px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-name { font-size: 20px; }
}

@media (max-width: 420px) {
  .auth-glow-ring { max-width: 100%; }
  .auth-card { padding: 1.25rem 1rem; }
}

@media (max-width: 540px) {
  .modal-overlay { align-items: flex-end; }
  .modal {
    max-width: 100% !important;
    width: 100%;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }
}

@media (max-width: 500px) {
  .coin-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
  .main { padding: 12px; }
}
