/* dev — layout and panel styles */
:root {
  --sidebar-w: 190px;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Sections */
.section {
  display: none;
  flex: 1;
  overflow: hidden;
}
.section.active {
  display: flex;
}
#section-bot {
  position: relative;
}
#section-playground {
  overflow-y: auto;
}
/* Content layout */
.content-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 0;
  overflow-y: auto;
}
.sidebar-group {
  margin-bottom: 20px;
}
.sidebar-label {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0 22px;
  margin-bottom: 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 20px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--mid);
  cursor: pointer;
  border: none;
  background: none;
  font-family: "Karla", sans-serif;
  width: 100%;
  text-align: left;
  border-left: 2px solid transparent;
  white-space: nowrap;
  transition:
    color 0.13s,
    background 0.13s,
    border-color 0.13s;
}
.sidebar-link:hover {
  color: var(--text);
  background: var(--surface);
}
.sidebar-link.active {
  color: var(--bright);
  border-left-color: var(--accent);
  background: rgba(99, 102, 241, 0.04);
}
.sidebar-link svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  flex-shrink: 0;
  opacity: 0.6;
}
.sidebar-link.active svg {
  opacity: 1;
}
.sidebar-pill {
  margin-left: auto;
  font-size: 0.54rem;
  font-weight: 600;
  background: var(--dim);
  color: var(--sub);
  padding: 1px 5px;
  border-radius: 6px;
}
.sidebar-link.active .sidebar-pill {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

/* Workspace */
.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tab {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.tab.active {
  display: flex;
}

.workspace-topbar {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 26px;
  flex-shrink: 0;
}
.workspace-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 26px;
}

.tab-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}
.tab-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--bright);
  letter-spacing: -0.02em;
}
.tab-sub {
  font-size: 0.68rem;
  color: var(--sub);
  margin-top: 3px;
  font-style: italic;
}

/* Changelog tabs */
.cl-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.cl-tab {
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 8px 16px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: "Karla", sans-serif;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.13s;
}
.cl-tab:hover {
  color: var(--text);
}
.cl-tab.active {
  color: var(--bright);
  border-bottom-color: var(--accent);
}

/* Table */
.table-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table thead tr {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.table th {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
}
.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  animation: fadeUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.table tbody tr:last-child {
  border-bottom: none;
}
.table tbody tr:hover {
  background: var(--surface);
}
.table td {
  padding: 11px 16px;
  vertical-align: top;
}
.td-title {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--bright);
  margin-bottom: 2px;
}
.td-sub {
  font-size: 0.67rem;
  color: var(--mid);
  font-weight: 300;
  font-style: italic;
  line-height: 1.4;
}
.td-mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  color: var(--sub);
}
.td-empty {
  text-align: center;
  padding: 40px 16px;
  font-size: 0.7rem;
  color: var(--dim);
  font-style: italic;
}
.td-actions {
  width: 1%;
  white-space: nowrap;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}
.row-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--r);
  border: 1px solid var(--border-mid);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mid);
  transition:
    color 0.13s,
    border-color 0.13s;
}
.row-btn:hover {
  color: var(--bright);
  border-color: var(--mid);
}
.row-btn svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
.row-btn.danger:hover {
  color: #a04040;
  border-color: rgba(160, 64, 64, 0.4);
}

/* Badges */
.post-tag {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid var(--border-mid);
  color: var(--sub);
  border-radius: var(--r);
}
.post-tag.tag-new {
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.25);
}
.post-tag.tag-fix {
  color: #6a6aaa;
  border-color: rgba(99, 102, 241, 0.15);
}
.post-tag.tag-notice {
  color: var(--sub);
}

.badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r);
  border: 1px solid;
  white-space: nowrap;
}
.badge-target {
  color: var(--sub);
  border-color: var(--dim);
}
.badge-active {
  color: #5bba8f;
  border-color: rgba(61, 158, 106, 0.3);
  background: rgba(61, 158, 106, 0.05);
}
.badge-wip {
  color: #c4962a;
  border-color: rgba(196, 150, 42, 0.3);
  background: rgba(196, 150, 42, 0.04);
}
.badge-planned {
  color: var(--mid);
  border-color: var(--border-mid);
}
.badge-open {
  color: #5bba8f;
  border-color: rgba(61, 158, 106, 0.3);
  background: rgba(61, 158, 106, 0.05);
}
.badge-closed {
  color: var(--sub);
  border-color: var(--border-mid);
}
.badge-tag-new {
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.04);
}
.badge-tag-fix {
  color: #5557a0;
  border-color: rgba(99, 102, 241, 0.15);
}
.badge-tag-notice {
  color: var(--sub);
  border-color: var(--dim);
}

/* Plans */
.plans-section {
  flex: 1;
  overflow-y: auto;
  padding: 26px;
}
.plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.plan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.plan-card-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--bright);
}
.plan-card-sub {
  font-size: 0.63rem;
  color: var(--mid);
  font-style: italic;
  margin-top: 2px;
}
.plan-price-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
}
.plan-price-sym {
  font-size: 0.8rem;
  color: var(--sub);
}
.plan-price-input {
  width: 48px;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  color: var(--bright);
  font-family: "Karla", sans-serif;
  font-size: 1.2rem;
  font-weight: 300;
  padding: 2px 4px;
  outline: none;
  border-radius: var(--r);
  text-align: center;
  transition: border-color 0.13s;
}
.plan-price-input:focus {
  border-color: var(--accent);
}
.plan-price-period {
  font-size: 0.62rem;
  color: var(--sub);
}
.plan-card-body {
  padding: 18px 20px;
  flex: 1;
}
.plan-card-footer {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Settings */
.settings-section {
  flex: 1;
  overflow-y: auto;
  padding: 26px;
}
.settings-group {
  margin-bottom: 22px;
}
.settings-group-title {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 9px;
}
.settings-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.settings-card.danger-card {
  border-color: rgba(160, 64, 64, 0.2);
}
.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.settings-row:last-child {
  border-bottom: none;
}
.settings-row-label {
  font-size: 0.72rem;
  color: var(--text);
}
.settings-row-desc {
  font-size: 0.62rem;
  color: var(--dim);
  font-style: italic;
  margin-top: 2px;
}

/* Fields */
.field-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 5px;
}
.field-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.6rem;
  color: var(--dim);
  font-style: italic;
}
.field-group {
  margin-bottom: 12px;
}
.field-group:last-child {
  margin-bottom: 0;
}
.field-row {
  display: flex;
  gap: 10px;
}
.field-row .field-group {
  flex: 1;
}
.field-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  color: var(--bright);
  font-family: "Karla", sans-serif;
  font-size: 0.72rem;
  padding: 7px 10px;
  outline: none;
  border-radius: var(--r);
  transition: border-color 0.13s;
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}
.field-input::placeholder {
  color: var(--dim);
}
.field-input.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
}
.field-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  color: var(--bright);
  font-family: "Karla", sans-serif;
  font-size: 0.72rem;
  padding: 7px 10px;
  outline: none;
  border-radius: var(--r);
  resize: vertical;
  min-height: 60px;
  line-height: 1.6;
  transition: border-color 0.13s;
}
.field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}
.field-textarea::placeholder {
  color: var(--dim);
  font-style: italic;
}
.field-textarea.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
}
.field-select {
  display: none; /* hidden — replaced by .cs-wrap */
}

/* Custom select */
.cs-wrap {
  position: relative;
  width: 100%;
}
.cs-trigger {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  color: var(--bright);
  font-family: "Karla", sans-serif;
  font-size: 0.72rem;
  padding: 7px 28px 7px 10px;
  border-radius: var(--r);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.13s;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
}
.cs-trigger:focus,
.cs-trigger.open {
  border-color: var(--accent);
}
.cs-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cs-arrow {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  margin-left: 8px;
  stroke: var(--dim);
  fill: none;
  stroke-width: 1.8;
  transition: transform 0.16s;
  stroke-linecap: round;
}
.cs-trigger.open .cs-arrow {
  transform: rotate(180deg);
}
.cs-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  z-index: 999;
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.cs-dropdown.open {
  display: block;
  animation: dropIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cs-option {
  padding: 7px 12px;
  font-size: 0.72rem;
  color: var(--mid);
  cursor: pointer;
  font-family: "Karla", sans-serif;
  transition:
    background 0.1s,
    color 0.1s;
}
.cs-option:hover {
  background: var(--surface);
  color: var(--bright);
}
.cs-option.selected {
  color: var(--bright);
  background: rgba(99, 102, 241, 0.08);
}

/* Custom number input */
.num-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.13s;
}
.num-wrap:focus-within {
  border-color: var(--accent);
}
.num-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--bright);
  font-family: "Karla", sans-serif;
  font-size: 0.72rem;
  padding: 7px 6px 7px 10px;
  min-width: 0;
  -moz-appearance: textfield;
}
.num-input::-webkit-inner-spin-button,
.num-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.num-btns {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.num-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dim);
  transition:
    color 0.1s,
    background 0.1s;
}
.num-btn:hover {
  color: var(--bright);
  background: var(--surface);
}
.num-btn svg {
  width: 7px;
  height: 7px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.num-btn + .num-btn {
  border-top: 1px solid var(--border);
}

/* Toggle — unified (bot-toggle aliases to toggle style) */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toggle-label {
  font-size: 0.62rem;
  color: var(--sub);
}
.toggle,
.bot-toggle-track {
  width: 26px;
  height: 14px;
  border-radius: 7px;
  background: var(--border-mid);
  position: relative;
  cursor: pointer;
  border: 1px solid var(--dim);
  flex-shrink: 0;
  transition:
    background 0.2s,
    border-color 0.2s;
  display: block;
}
.toggle.on,
.bot-toggle input:checked + .bot-toggle-track {
  background: rgba(99, 102, 241, 0.4);
  border-color: rgba(99, 102, 241, 0.5);
}
.toggle::after,
.bot-toggle-thumb {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sub);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s;
}
.bot-toggle-thumb {
  content: none;
}
.toggle.on::after {
  transform: translateX(12px);
  background: var(--accent);
}
.bot-toggle input:checked + .bot-toggle-track .bot-toggle-thumb {
  transform: translateX(12px);
  background: var(--accent);
}
.bot-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.bot-toggle input {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--r);
  cursor: pointer;
  border: 1px solid;
  font-family: "Karla", sans-serif;
  transition: all 0.13s;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.97);
}
.btn svg {
  width: 9px;
  height: 9px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.btn-primary {
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.3);
  background: none;
}
.btn-primary:hover {
  border-color: var(--accent);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
.btn-ghost {
  background: none;
  border-color: var(--border-mid);
  color: var(--dim);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--mid);
}
.btn-danger {
  background: none;
  border-color: rgba(160, 64, 64, 0.3);
  color: #a04040;
}
.btn-danger:hover {
  border-color: #a04040;
}

/* Dev modals */
.modal-dev {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  width: 440px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}
.modal-dev.modal-lg {
  width: 560px;
}
.modal-dev.modal-sm {
  width: 340px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}
.modal-title-dev {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--bright);
}
.modal-close {
  width: 22px;
  height: 22px;
  border-radius: var(--r);
  border: none;
  background: var(--dim);
  cursor: pointer;
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.13s;
}
.modal-close:hover {
  color: var(--bright);
}
.modal-close svg {
  width: 9px;
  height: 9px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}
.modal-body {
  padding: 18px 22px;
}
.modal-footer {
  display: flex;
  gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
}
.confirm-text {
  font-size: 0.68rem;
  color: var(--mid);
  font-style: italic;
  line-height: 1.6;
}

/* Topbar */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-back {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.63rem;
  color: var(--sub);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.13s;
}
.topbar-back:hover {
  color: var(--text);
}
.topbar-back svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  transform: scaleX(-1);
}

/* Bot dashboard */
.bot-dash {
  display: flex;
  height: 100%;
  position: absolute;
  inset: 0;
}

/* Bot sidebar */
.bot-sidebar {
  width: 170px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  overflow-y: auto;
}
.bot-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.bot-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
  transition: background 0.2s;
}
.bot-status-indicator.online {
  background: #5bba8f;
  box-shadow: 0 0 5px rgba(91, 186, 143, 0.4);
}
.bot-status-indicator.idle {
  background: #c4962a;
}
.bot-status-indicator.dnd {
  background: #b05050;
}
.bot-status-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bot-status-label {
  font-size: 0.68rem;
  color: var(--text);
  font-weight: 500;
}
.bot-status-uptime {
  font-size: 0.56rem;
  color: var(--dim);
}

.bot-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.bot-ctrl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.64rem;
  font-family: "Karla", sans-serif;
  font-weight: 500;
  color: var(--mid);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 5px 10px;
  cursor: pointer;
  text-align: left;
  transition:
    color 0.13s,
    border-color 0.13s;
}
.bot-ctrl-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  flex-shrink: 0;
}
.bot-ctrl-btn:hover {
  color: var(--bright);
  border-color: var(--mid);
}
.bot-ctrl-btn.green {
  color: #5bba8f;
  border-color: rgba(91, 186, 143, 0.25);
}
.bot-ctrl-btn.green:hover {
  color: #7dd5aa;
  border-color: rgba(91, 186, 143, 0.5);
}
.bot-ctrl-btn.red {
  color: #b05050;
  border-color: rgba(176, 80, 80, 0.25);
}
.bot-ctrl-btn.red:hover {
  color: #d07070;
  border-color: rgba(176, 80, 80, 0.5);
}

.bot-nav {
  display: flex;
  flex-direction: column;
}
.bot-nav-label {
  font-size: 0.53rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 8px 14px 3px;
  margin-top: 4px;
}
.bot-nav-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  font-size: 0.68rem;
  font-family: "Karla", sans-serif;
  color: var(--mid);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition:
    color 0.12s,
    background 0.12s;
  border-left: 2px solid transparent;
}
.bot-nav-item svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
  opacity: 0.6;
}
.bot-nav-item:hover {
  color: var(--text);
}
.bot-nav-item.active {
  color: var(--bright);
  border-left-color: var(--accent);
  background: rgba(99, 102, 241, 0.04);
}
.bot-nav-item.active svg {
  opacity: 1;
}

/* Bot main */
.bot-main {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.bot-view {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px;
  flex-direction: column;
  gap: 16px;
}
.bot-view.active {
  display: flex;
  animation: panelIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.bot-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.bot-view-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bright);
  letter-spacing: -0.02em;
}

/* Stats grid */
.bot-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.bot-stat-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 12px 14px;
}
.bot-stat-label {
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}
.bot-stat-val {
  font-size: 1rem;
  font-weight: 500;
  color: var(--bright);
  letter-spacing: -0.02em;
}

.bot-guild-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.bot-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.bot-card-title {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 12px 14px 0;
}
.bot-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.bot-info-row:last-child {
  border-bottom: none;
}
.bot-info-label {
  color: var(--dim);
}
.bot-info-val {
  color: var(--text);
  font-weight: 400;
}

/* Logs */
.bot-logs {
  flex: 1;
  overflow-y: auto;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.62rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  background: var(--surface);
  min-height: 300px;
}
.bot-log-empty {
  color: var(--dim);
  font-style: italic;
  font-family: "Karla", sans-serif;
}
.bot-log-line {
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}
.bot-log-line.stdout {
  color: var(--text);
}
.bot-log-line.stderr {
  color: #b05050;
}
.bot-log-line.system {
  color: var(--dim);
  font-style: italic;
}
.bot-log-ts {
  color: var(--dim);
  margin-right: 6px;
  font-size: 0.58rem;
}

/* Guild list */
.bot-guild-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
}
.bot-guild-row:last-child {
  border-bottom: none;
}
.bot-guild-name {
  color: var(--bright);
  font-weight: 400;
  flex: 1;
}
.bot-guild-meta {
  font-size: 0.6rem;
  color: var(--dim);
}

/* Automod rule rows */
.bot-rule-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
}
.bot-rule-row:last-child {
  border-bottom: none;
}
.bot-rule-type {
  color: var(--bright);
}
.bot-rule-action {
  color: var(--mid);
  font-size: 0.62rem;
}

/* Tag chips */
.bot-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bot-tag-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  padding: 3px 8px;
  font-size: 0.62rem;
  color: var(--text);
}
.bot-tag-chip-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dim);
  padding: 0;
  line-height: 1;
  font-size: 0.8rem;
}
.bot-tag-chip-del:hover {
  color: #b05050;
}

.bot-link-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.bot-sub-title {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}

/* Violation rows */
.bot-vio-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
}
.bot-vio-row:last-child {
  border-bottom: none;
}

/* Ticket rows */
.bot-ticket-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
}
.bot-ticket-row:last-child {
  border-bottom: none;
}
.bot-ticket-id {
  font-size: 0.58rem;
  color: var(--dim);
  font-family: monospace;
}

/* btn-sm */
.btn-sm {
  font-size: 0.58rem;
  padding: 4px 10px;
}

/* Playground */
#section-playground {
  flex-direction: column;
}
#section-playground .workspace-scroll {
  flex: 1;
  overflow-y: auto;
}
.pg-group {
  margin-bottom: 28px;
}
.pg-group-title {
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.pg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pg-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Table helpers */
.panel-empty {
  font-size: 0.68rem;
  color: var(--dim);
  font-style: italic;
  padding: 24px 0 24px 16px;
}
.table-empty {
  text-align: center;
  color: var(--dim);
  font-size: 0.68rem;
  font-style: italic;
  padding: 28px 0;
}
.row-title {
  display: block;
  font-size: 0.7rem;
  color: var(--bright);
  font-weight: 500;
}
.row-sub {
  display: block;
  font-size: 0.63rem;
  color: var(--dim);
  margin-top: 1px;
}
.mono-dim {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--mid);
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.row-btn.danger {
  color: #a04040;
}
.row-btn.danger:hover {
  color: #c06060;
}
