/* ==========================================================================
   Right Accounts Drawer Component (Collapsible Multi-Account Hierarchy)
   ========================================================================== */

.drawer-header {
  padding: 1rem 1.15rem 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.btn-icon-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Search Box */
.drawer-search-wrap {
  padding: 0.75rem 1rem 0.4rem 1rem;
}

.drawer-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 0.45rem 0.75rem;
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.drawer-search-input:focus {
  border-color: var(--accent-cyan);
}

/* Action Buttons (+ Group, + Account) */
.drawer-actions-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 1rem 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-drawer-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.btn-drawer-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-light);
}

/* Groups List */
.drawer-groups-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.group-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-header-badge {
  font-size: 10px;
  color: var(--accent-emerald);
}

/* Account List Item */
.acc-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
}

.acc-list-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.acc-list-item.selected {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.12);
}

.acc-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.acc-status-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--accent-emerald);
  flex-shrink: 0;
}

.acc-item-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.acc-item-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-item-server {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.acc-item-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0.35;
  transition: opacity 0.15s ease;
}

.acc-list-item:hover .acc-item-tools,
.acc-list-item.selected .acc-item-tools {
  opacity: 1;
}

.btn-tool-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-tool-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Drawer Footer */
.drawer-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.drawer-footer-stats {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.btn-install-device {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
