/* ═══════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════ */
:root {
  --bg:         #0b0c10;
  --sidebar:    #0e0f15;
  --card:       #161821;
  --card2:      #1c1e2a;
  --border:     rgba(255,255,255,0.055);
  --border2:    rgba(255,255,255,0.11);
  --text:       #e3e3ef;
  --muted:      #64648a;
  --sub:        #9292b8;
  --accent:     #7c5cf7;
  --accentl:    #9d84ff;
  --accent-bg:  rgba(124,92,247,0.13);
  --accent-glow:rgba(124,92,247,0.22);
  --green:      #34d399;
  --green-dim:  rgba(52,211,153,0.12);
  --red:        #f87171;
  --red-dim:    rgba(248,113,113,0.12);
  --amber:      #fbbf24;
  --amber-dim:  rgba(251,191,36,0.12);
  --radius:     10px;
  --radius-sm:  6px;
  --sb-width:   232px;
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:  'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accentl); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
code { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════ */
#toasts {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 340px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13.5px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  pointer-events: auto;
  animation: slideIn .25s cubic-bezier(.34,1.56,.64,1) both;
}
.toast.ok   { border-left: 3px solid var(--green); }
.toast.err  { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }
.toast.warn { border-left: 3px solid var(--amber); }
.toast-ico  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-text { flex: 1; color: var(--text); }
.toast.fade { animation: fadeOut .3s ease both; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px) scale(.95); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px) scale(.95); }
}

/* ═══════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: popIn .22s cubic-bezier(.34,1.56,.64,1);
}
.modal-icon { font-size: 36px; margin-bottom: 12px; }
.modal p { color: var(--sub); font-size: 14.5px; line-height: 1.6; margin-bottom: 24px; }
.modal-btns { display: flex; gap: 10px; justify-content: center; }
@keyframes popIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}
.orb1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #7c5cf7 0%, transparent 70%);
  top: -120px; left: -100px;
}
.orb2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
  bottom: -100px; right: -80px;
}
.login-card {
  position: relative;
  background: rgba(22,24,33,0.85);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(20px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: popIn .35s cubic-bezier(.34,1.56,.64,1);
}
.login-logo {
  width: 64px; height: 64px;
  background: var(--accent-bg);
  border: 1px solid var(--border2);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  margin-bottom: 4px;
  box-shadow: 0 0 40px var(--accent-glow);
}
.login-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--text);
}
.login-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}
.login-input {
  width: 100%;
  padding: 11px 40px 11px 14px;
}
.login-btn { width: 100%; margin-top: 4px; }
.login-err {
  color: var(--red);
  font-size: 13px;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════ */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width: var(--sb-width);
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.sb-logo-icon { font-size: 20px; }

.sb-bot-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.sb-bot-avatar {
  position: relative;
  flex-shrink: 0;
  width: 38px; height: 38px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sb-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--sidebar);
}
.dot-off    { background: var(--muted); }
.dot-on     { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.dot-error  { background: var(--red); }
.dot-busy   { background: var(--amber); }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 6px var(--green); }
  50%      { box-shadow: 0 0 14px var(--green); }
}
.sb-bot-info { min-width: 0; }
.sb-bot-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-bot-status { font-size: 11px; color: var(--muted); }

.sb-server-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.sb-server-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--card2);
  flex-shrink: 0;
}
.sb-server-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-server-sub { font-size: 11px; color: var(--muted); }

/* Sidebar stats */
.sb-stats {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.sb-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.sb-stat-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.sb-stat-item.green  .sb-stat-val { color: var(--green); }
.sb-stat-item.accent .sb-stat-val { color: var(--accentl); }
.sb-stat-item.dimmed .sb-stat-val { color: var(--sub); }
.sb-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.sb-stat-lbl { font-size: 10px; color: var(--muted); margin-top: 3px; }
.sb-stats-note { font-size: 11px; color: var(--muted); line-height: 1.4; margin-bottom: 8px; }
.sb-refresh-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--sub);
  font-size: 11.5px;
  transition: all .15s;
}
.sb-refresh-btn:hover {
  background: var(--card);
  color: var(--text);
  border-color: var(--border2);
}

/* Sidebar nav */
.sb-nav {
  padding: 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--sub);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: all .15s;
}
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-bg);
  color: var(--accentl);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-ico { font-size: 16px; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sb-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.sb-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  transition: all .15s;
}
.sb-logout:hover {
  background: var(--red-dim);
  color: var(--red);
}

/* ── Main content ────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ── Pages ───────────────────────────────────────── */
.page { display: none; flex-direction: column; gap: 20px; }
.page.active { display: flex; animation: fadeInPage .2s ease; }
@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--text);
}
.page-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.page-head-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   SETUP BANNER
═══════════════════════════════════════════════════ */
.setup-banner {
  background: linear-gradient(135deg, rgba(124,92,247,0.1), rgba(79,70,229,0.08));
  border: 1px solid rgba(124,92,247,0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.setup-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}
.setup-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
  animation: pulse-amber 2s infinite;
}
@keyframes pulse-amber {
  0%,100% { box-shadow: 0 0 0 0 rgba(251,191,36,.5); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}
.setup-left strong { color: var(--text); font-size: 13.5px; }
.setup-left p { font-size: 12px; color: var(--sub); }
.setup-steps {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setup-step {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--sub);
}
.setup-step.done { color: var(--green); border-color: var(--green-dim); }
.step-n {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 18px; height: 18px;
  background: var(--accent-bg);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: var(--accentl);
}
.setup-step.done .step-n {
  background: var(--green-dim);
  color: var(--green);
}
.setup-arrow { color: var(--muted); font-size: 12px; }
.setup-cta {
  background: var(--accent);
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.setup-cta:hover { background: var(--accentl); }

/* ═══════════════════════════════════════════════════
   ALERT BANNER
═══════════════════════════════════════════════════ */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--amber-dim);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 8px;
  font-size: 13px;
  color: var(--amber);
}
.alert-link {
  background: none;
  border: none;
  color: var(--amber);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* ═══════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-ico {
  font-size: 18px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  flex-shrink: 0;
}
.card-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.card-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tag-opt {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 4px;
}
.char-counter {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.char-counter.near { color: var(--amber); }
.char-counter.over { color: var(--red); }

input[type=text],
input[type=password],
select,
textarea {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--text);
  transition: border .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input[type=text]:focus,
input[type=password]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236464aa'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
select option { background: #1c1e2a; }

.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em; }

fieldset:disabled input,
fieldset:disabled select,
fieldset:disabled textarea,
fieldset:disabled button {
  opacity: 0.45;
  cursor: not-allowed;
}
fieldset { border: none; padding: 0; min-width: 0; }

.input-hint {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.hint-chip {
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
}
.hint-chip code { color: var(--accentl); font-size: 11px; }

.pw-wrap { position: relative; width: 100%; }
.pw-wrap input { padding-right: 40px; }
.pw-toggle {
  position: absolute;
  right: 1px; top: 1px; bottom: 1px;
  width: 38px;
  background: transparent;
  border: none;
  border-radius: 0 7px 7px 0;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 15px; height: 15px; }

.field-info {
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.inline-form { display: flex; gap: 10px; margin-bottom: 10px; }
.inline-form input { flex: 1; }

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  width: 100%;
  transition: all .15s;
  box-shadow: 0 4px 16px rgba(124,92,247,0.25);
}
.btn-accent:hover:not(:disabled) {
  background: var(--accentl);
  box-shadow: 0 4px 20px rgba(124,92,247,0.4);
  transform: translateY(-1px);
}
.btn-accent:active:not(:disabled) { transform: none; }
.btn-accent:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 10px 18px;
  color: var(--sub);
  font-weight: 500;
  font-size: 13.5px;
  transition: all .15s;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: var(--border2);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--red-dim);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: 8px;
  padding: 10px 18px;
  color: var(--red);
  font-weight: 600;
  font-size: 13.5px;
  transition: all .15s;
}
.btn-danger:hover { background: rgba(248,113,113,0.2); }

.btn-stop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red-dim);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 7px;
  padding: 7px 12px;
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
  transition: all .15s;
}
.btn-stop:hover { background: rgba(248,113,113,0.2); }

.btn-full { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.mt8 { margin-top: 8px; }

.send-btn { margin-top: 8px; }

/* ═══════════════════════════════════════════════════
   DM PAGE GRID
═══════════════════════════════════════════════════ */
.dm-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}

/* ── Status card ─────────────────────────────────── */
.status-card { display: flex; flex-direction: column; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 8px;
}
.empty-visual { font-size: 40px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--sub); }
.empty-sub { font-size: 12.5px; color: var(--muted); max-width: 240px; }

.job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.job-target-lbl { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.job-target-val { font-size: 14px; font-weight: 600; color: var(--text); }

.prog-wrap {
  position: relative;
  height: 8px;
  background: var(--card2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.prog-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--accentl));
  border-radius: 99px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.prog-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 1.8s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%); }
}
.prog-text {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-bottom: 20px;
}

.job-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.job-stat {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.job-stat-val { font-size: 22px; font-weight: 700; }
.job-stat-val.green { color: var(--green); }
.job-stat-val.red   { color: var(--red); }
.job-stat-val.dim   { color: var(--sub); }
.job-stat-lbl { font-size: 11px; color: var(--muted); margin-top: 3px; }

.result-box {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--sub);
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════
   HISTORY TABLE
═══════════════════════════════════════════════════ */
.hist-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.hist-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--card2);
  border-bottom: 1px solid var(--border);
}
.hist-table th:first-child { border-radius: 8px 0 0 0; }
.hist-table th:last-child  { border-radius: 0 8px 0 0; }
.hist-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--sub);
  vertical-align: top;
}
.hist-table tr:last-child td { border-bottom: none; }
.hist-table tbody tr:hover td { background: rgba(255,255,255,0.025); }

.hist-date { color: var(--text); font-weight: 500; font-size: 13px; }
.hist-dur  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.hist-target {
  font-weight: 500;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.hist-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent-bg);
  color: var(--accentl);
  white-space: nowrap;
}
.hist-baslik { font-size: 11px; color: var(--muted); margin-top: 2px; }

.rate-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rate-bar {
  height: 5px;
  flex: 1;
  background: var(--card2);
  border-radius: 99px;
  overflow: hidden;
}
.rate-fill {
  height: 100%;
  background: var(--green);
  border-radius: 99px;
}
.rate-pct { font-size: 12px; font-weight: 600; color: var(--text); min-width: 36px; }

.expand-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 11.5px;
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
}
.expand-btn:hover { background: var(--card2); color: var(--text); border-color: var(--border2); }

/* Expanded detail row */
.hist-detail td {
  padding: 0 14px 14px;
  background: var(--card2);
}
.hist-detail-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.hist-detail-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.hist-detail-section:last-child { border-bottom: none; }
.hist-detail-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 8px;
}
.hist-msg-text {
  font-size: 13px;
  color: var(--sub);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  max-height: 120px;
  overflow-y: auto;
}
.hist-fail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 130px;
  overflow-y: auto;
}
.hist-fail-item {
  font-size: 12.5px;
  color: var(--red);
  font-family: var(--font-mono);
  background: var(--red-dim);
  padding: 4px 10px;
  border-radius: 5px;
}
.hist-read-note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.num-green { color: var(--green); font-weight: 600; }
.num-red   { color: var(--red); font-weight: 600; }
.num-dim   { color: var(--muted); }

/* ═══════════════════════════════════════════════════
   SETTINGS PAGE
═══════════════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-fb {
  font-size: 12.5px;
  margin-top: 6px;
}
.form-fb.ok  { color: var(--green); }
.form-fb.err { color: var(--red); }

/* Token table */
.table-wrap { overflow-x: auto; }
.token-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.token-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.token-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--sub);
  vertical-align: middle;
}
.token-table tr:last-child td { border-bottom: none; }
.token-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.token-label { font-weight: 600; color: var(--text); font-size: 13px; }
.token-masked { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 5px;
}
.badge-active {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.25);
}
.badge-inactive {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border: 1px solid var(--border);
}

.token-tag-small { font-size: 10.5px; color: var(--muted); margin-top: 3px; font-family: var(--font-mono); }
.token-actions { display: flex; gap: 6px; }
.token-action-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 11px;
  color: var(--muted);
  font-size: 12px;
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
}
.token-action-btn:hover { background: var(--card2); color: var(--text); border-color: var(--border2); }
.token-action-btn.activate:hover { color: var(--green); border-color: rgba(52,211,153,.3); background: var(--green-dim); }
.token-action-btn.delete:hover   { color: var(--red);   border-color: rgba(248,113,113,.3); background: var(--red-dim); }

/* ═══════════════════════════════════════════════════
   MULTI-BOT INDICATORS
═══════════════════════════════════════════════════ */
.sb-secondary-bar {
  padding: 6px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.secondary-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: 5px;
  padding: 3px 10px;
}
.secondary-count::before { content: '●'; font-size: 8px; }

.bot-count-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--green-dim);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: 8px;
  font-size: 13px;
}
.bot-count-icon { font-size: 16px; }
.bot-count-bar strong { color: var(--green); }
.bot-count-hint { color: var(--muted); font-size: 12px; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .dm-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .sidebar { display: none; }
  .main { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
}
